proteus  1.5.1
C/C++/Fortran libraries
BoundaryConditions.c
Go to the documentation of this file.
1 /* Generated by Cython 0.28.5 */
2 
3 #define PY_SSIZE_T_CLEAN
4 #include "Python.h"
5 #ifndef Py_PYTHON_H
6  #error Python headers needed to compile C extensions, please install development version of Python.
7 #elif PY_VERSION_HEX < 0x02060000 || (0x03000000 <= PY_VERSION_HEX && PY_VERSION_HEX < 0x03030000)
8  #error Cython requires Python 2.6+ or Python 3.3+.
9 #else
10 #define CYTHON_ABI "0_28_5"
11 #define CYTHON_FUTURE_DIVISION 0
12 #include <stddef.h>
13 #ifndef offsetof
14  #define offsetof(type, member) ( (size_t) & ((type*)0) -> member )
15 #endif
16 #if !defined(WIN32) && !defined(MS_WINDOWS)
17  #ifndef __stdcall
18  #define __stdcall
19  #endif
20  #ifndef __cdecl
21  #define __cdecl
22  #endif
23  #ifndef __fastcall
24  #define __fastcall
25  #endif
26 #endif
27 #ifndef DL_IMPORT
28  #define DL_IMPORT(t) t
29 #endif
30 #ifndef DL_EXPORT
31  #define DL_EXPORT(t) t
32 #endif
33 #define __PYX_COMMA ,
34 #ifndef HAVE_LONG_LONG
35  #if PY_VERSION_HEX >= 0x02070000
36  #define HAVE_LONG_LONG
37  #endif
38 #endif
39 #ifndef PY_LONG_LONG
40  #define PY_LONG_LONG LONG_LONG
41 #endif
42 #ifndef Py_HUGE_VAL
43  #define Py_HUGE_VAL HUGE_VAL
44 #endif
45 #ifdef PYPY_VERSION
46  #define CYTHON_COMPILING_IN_PYPY 1
47  #define CYTHON_COMPILING_IN_PYSTON 0
48  #define CYTHON_COMPILING_IN_CPYTHON 0
49  #undef CYTHON_USE_TYPE_SLOTS
50  #define CYTHON_USE_TYPE_SLOTS 0
51  #undef CYTHON_USE_PYTYPE_LOOKUP
52  #define CYTHON_USE_PYTYPE_LOOKUP 0
53  #if PY_VERSION_HEX < 0x03050000
54  #undef CYTHON_USE_ASYNC_SLOTS
55  #define CYTHON_USE_ASYNC_SLOTS 0
56  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
57  #define CYTHON_USE_ASYNC_SLOTS 1
58  #endif
59  #undef CYTHON_USE_PYLIST_INTERNALS
60  #define CYTHON_USE_PYLIST_INTERNALS 0
61  #undef CYTHON_USE_UNICODE_INTERNALS
62  #define CYTHON_USE_UNICODE_INTERNALS 0
63  #undef CYTHON_USE_UNICODE_WRITER
64  #define CYTHON_USE_UNICODE_WRITER 0
65  #undef CYTHON_USE_PYLONG_INTERNALS
66  #define CYTHON_USE_PYLONG_INTERNALS 0
67  #undef CYTHON_AVOID_BORROWED_REFS
68  #define CYTHON_AVOID_BORROWED_REFS 1
69  #undef CYTHON_ASSUME_SAFE_MACROS
70  #define CYTHON_ASSUME_SAFE_MACROS 0
71  #undef CYTHON_UNPACK_METHODS
72  #define CYTHON_UNPACK_METHODS 0
73  #undef CYTHON_FAST_THREAD_STATE
74  #define CYTHON_FAST_THREAD_STATE 0
75  #undef CYTHON_FAST_PYCALL
76  #define CYTHON_FAST_PYCALL 0
77  #undef CYTHON_PEP489_MULTI_PHASE_INIT
78  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
79  #undef CYTHON_USE_TP_FINALIZE
80  #define CYTHON_USE_TP_FINALIZE 0
81 #elif defined(PYSTON_VERSION)
82  #define CYTHON_COMPILING_IN_PYPY 0
83  #define CYTHON_COMPILING_IN_PYSTON 1
84  #define CYTHON_COMPILING_IN_CPYTHON 0
85  #ifndef CYTHON_USE_TYPE_SLOTS
86  #define CYTHON_USE_TYPE_SLOTS 1
87  #endif
88  #undef CYTHON_USE_PYTYPE_LOOKUP
89  #define CYTHON_USE_PYTYPE_LOOKUP 0
90  #undef CYTHON_USE_ASYNC_SLOTS
91  #define CYTHON_USE_ASYNC_SLOTS 0
92  #undef CYTHON_USE_PYLIST_INTERNALS
93  #define CYTHON_USE_PYLIST_INTERNALS 0
94  #ifndef CYTHON_USE_UNICODE_INTERNALS
95  #define CYTHON_USE_UNICODE_INTERNALS 1
96  #endif
97  #undef CYTHON_USE_UNICODE_WRITER
98  #define CYTHON_USE_UNICODE_WRITER 0
99  #undef CYTHON_USE_PYLONG_INTERNALS
100  #define CYTHON_USE_PYLONG_INTERNALS 0
101  #ifndef CYTHON_AVOID_BORROWED_REFS
102  #define CYTHON_AVOID_BORROWED_REFS 0
103  #endif
104  #ifndef CYTHON_ASSUME_SAFE_MACROS
105  #define CYTHON_ASSUME_SAFE_MACROS 1
106  #endif
107  #ifndef CYTHON_UNPACK_METHODS
108  #define CYTHON_UNPACK_METHODS 1
109  #endif
110  #undef CYTHON_FAST_THREAD_STATE
111  #define CYTHON_FAST_THREAD_STATE 0
112  #undef CYTHON_FAST_PYCALL
113  #define CYTHON_FAST_PYCALL 0
114  #undef CYTHON_PEP489_MULTI_PHASE_INIT
115  #define CYTHON_PEP489_MULTI_PHASE_INIT 0
116  #undef CYTHON_USE_TP_FINALIZE
117  #define CYTHON_USE_TP_FINALIZE 0
118 #else
119  #define CYTHON_COMPILING_IN_PYPY 0
120  #define CYTHON_COMPILING_IN_PYSTON 0
121  #define CYTHON_COMPILING_IN_CPYTHON 1
122  #ifndef CYTHON_USE_TYPE_SLOTS
123  #define CYTHON_USE_TYPE_SLOTS 1
124  #endif
125  #if PY_VERSION_HEX < 0x02070000
126  #undef CYTHON_USE_PYTYPE_LOOKUP
127  #define CYTHON_USE_PYTYPE_LOOKUP 0
128  #elif !defined(CYTHON_USE_PYTYPE_LOOKUP)
129  #define CYTHON_USE_PYTYPE_LOOKUP 1
130  #endif
131  #if PY_MAJOR_VERSION < 3
132  #undef CYTHON_USE_ASYNC_SLOTS
133  #define CYTHON_USE_ASYNC_SLOTS 0
134  #elif !defined(CYTHON_USE_ASYNC_SLOTS)
135  #define CYTHON_USE_ASYNC_SLOTS 1
136  #endif
137  #if PY_VERSION_HEX < 0x02070000
138  #undef CYTHON_USE_PYLONG_INTERNALS
139  #define CYTHON_USE_PYLONG_INTERNALS 0
140  #elif !defined(CYTHON_USE_PYLONG_INTERNALS)
141  #define CYTHON_USE_PYLONG_INTERNALS 1
142  #endif
143  #ifndef CYTHON_USE_PYLIST_INTERNALS
144  #define CYTHON_USE_PYLIST_INTERNALS 1
145  #endif
146  #ifndef CYTHON_USE_UNICODE_INTERNALS
147  #define CYTHON_USE_UNICODE_INTERNALS 1
148  #endif
149  #if PY_VERSION_HEX < 0x030300F0
150  #undef CYTHON_USE_UNICODE_WRITER
151  #define CYTHON_USE_UNICODE_WRITER 0
152  #elif !defined(CYTHON_USE_UNICODE_WRITER)
153  #define CYTHON_USE_UNICODE_WRITER 1
154  #endif
155  #ifndef CYTHON_AVOID_BORROWED_REFS
156  #define CYTHON_AVOID_BORROWED_REFS 0
157  #endif
158  #ifndef CYTHON_ASSUME_SAFE_MACROS
159  #define CYTHON_ASSUME_SAFE_MACROS 1
160  #endif
161  #ifndef CYTHON_UNPACK_METHODS
162  #define CYTHON_UNPACK_METHODS 1
163  #endif
164  #ifndef CYTHON_FAST_THREAD_STATE
165  #define CYTHON_FAST_THREAD_STATE 1
166  #endif
167  #ifndef CYTHON_FAST_PYCALL
168  #define CYTHON_FAST_PYCALL 1
169  #endif
170  #ifndef CYTHON_PEP489_MULTI_PHASE_INIT
171  #define CYTHON_PEP489_MULTI_PHASE_INIT (0 && PY_VERSION_HEX >= 0x03050000)
172  #endif
173  #ifndef CYTHON_USE_TP_FINALIZE
174  #define CYTHON_USE_TP_FINALIZE (PY_VERSION_HEX >= 0x030400a1)
175  #endif
176 #endif
177 #if !defined(CYTHON_FAST_PYCCALL)
178 #define CYTHON_FAST_PYCCALL (CYTHON_FAST_PYCALL && PY_VERSION_HEX >= 0x030600B1)
179 #endif
180 #if CYTHON_USE_PYLONG_INTERNALS
181  #include "longintrepr.h"
182  #undef SHIFT
183  #undef BASE
184  #undef MASK
185 #endif
186 #ifndef __has_attribute
187  #define __has_attribute(x) 0
188 #endif
189 #ifndef __has_cpp_attribute
190  #define __has_cpp_attribute(x) 0
191 #endif
192 #ifndef CYTHON_RESTRICT
193  #if defined(__GNUC__)
194  #define CYTHON_RESTRICT __restrict__
195  #elif defined(_MSC_VER) && _MSC_VER >= 1400
196  #define CYTHON_RESTRICT __restrict
197  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
198  #define CYTHON_RESTRICT restrict
199  #else
200  #define CYTHON_RESTRICT
201  #endif
202 #endif
203 #ifndef CYTHON_UNUSED
204 # if defined(__GNUC__)
205 # if !(defined(__cplusplus)) || (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 4))
206 # define CYTHON_UNUSED __attribute__ ((__unused__))
207 # else
208 # define CYTHON_UNUSED
209 # endif
210 # elif defined(__ICC) || (defined(__INTEL_COMPILER) && !defined(_MSC_VER))
211 # define CYTHON_UNUSED __attribute__ ((__unused__))
212 # else
213 # define CYTHON_UNUSED
214 # endif
215 #endif
216 #ifndef CYTHON_MAYBE_UNUSED_VAR
217 # if defined(__cplusplus)
218  template<class T> void CYTHON_MAYBE_UNUSED_VAR( const T& ) { }
219 # else
220 # define CYTHON_MAYBE_UNUSED_VAR(x) (void)(x)
221 # endif
222 #endif
223 #ifndef CYTHON_NCP_UNUSED
224 # if CYTHON_COMPILING_IN_CPYTHON
225 # define CYTHON_NCP_UNUSED
226 # else
227 # define CYTHON_NCP_UNUSED CYTHON_UNUSED
228 # endif
229 #endif
230 #define __Pyx_void_to_None(void_result) ((void)(void_result), Py_INCREF(Py_None), Py_None)
231 #ifdef _MSC_VER
232  #ifndef _MSC_STDINT_H_
233  #if _MSC_VER < 1300
234  typedef unsigned char uint8_t;
235  typedef unsigned int uint32_t;
236  #else
237  typedef unsigned __int8 uint8_t;
238  typedef unsigned __int32 uint32_t;
239  #endif
240  #endif
241 #else
242  #include <stdint.h>
243 #endif
244 #ifndef CYTHON_FALLTHROUGH
245  #if defined(__cplusplus) && __cplusplus >= 201103L
246  #if __has_cpp_attribute(fallthrough)
247  #define CYTHON_FALLTHROUGH [[fallthrough]]
248  #elif __has_cpp_attribute(clang::fallthrough)
249  #define CYTHON_FALLTHROUGH [[clang::fallthrough]]
250  #elif __has_cpp_attribute(gnu::fallthrough)
251  #define CYTHON_FALLTHROUGH [[gnu::fallthrough]]
252  #endif
253  #endif
254  #ifndef CYTHON_FALLTHROUGH
255  #if __has_attribute(fallthrough)
256  #define CYTHON_FALLTHROUGH __attribute__((fallthrough))
257  #else
258  #define CYTHON_FALLTHROUGH
259  #endif
260  #endif
261  #if defined(__clang__ ) && defined(__apple_build_version__)
262  #if __apple_build_version__ < 7000000
263  #undef CYTHON_FALLTHROUGH
264  #define CYTHON_FALLTHROUGH
265  #endif
266  #endif
267 #endif
268 
269 #ifndef CYTHON_INLINE
270  #if defined(__clang__)
271  #define CYTHON_INLINE __inline__ __attribute__ ((__unused__))
272  #elif defined(__GNUC__)
273  #define CYTHON_INLINE __inline__
274  #elif defined(_MSC_VER)
275  #define CYTHON_INLINE __inline
276  #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
277  #define CYTHON_INLINE inline
278  #else
279  #define CYTHON_INLINE
280  #endif
281 #endif
282 
283 #if CYTHON_COMPILING_IN_PYPY && PY_VERSION_HEX < 0x02070600 && !defined(Py_OptimizeFlag)
284  #define Py_OptimizeFlag 0
285 #endif
286 #define __PYX_BUILD_PY_SSIZE_T "n"
287 #define CYTHON_FORMAT_SSIZE_T "z"
288 #if PY_MAJOR_VERSION < 3
289  #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
290  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
291  PyCode_New(a+k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
292  #define __Pyx_DefaultClassType PyClass_Type
293 #else
294  #define __Pyx_BUILTIN_MODULE_NAME "builtins"
295  #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)\
296  PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
297  #define __Pyx_DefaultClassType PyType_Type
298 #endif
299 #ifndef Py_TPFLAGS_CHECKTYPES
300  #define Py_TPFLAGS_CHECKTYPES 0
301 #endif
302 #ifndef Py_TPFLAGS_HAVE_INDEX
303  #define Py_TPFLAGS_HAVE_INDEX 0
304 #endif
305 #ifndef Py_TPFLAGS_HAVE_NEWBUFFER
306  #define Py_TPFLAGS_HAVE_NEWBUFFER 0
307 #endif
308 #ifndef Py_TPFLAGS_HAVE_FINALIZE
309  #define Py_TPFLAGS_HAVE_FINALIZE 0
310 #endif
311 #if PY_VERSION_HEX <= 0x030700A3 || !defined(METH_FASTCALL)
312  #ifndef METH_FASTCALL
313  #define METH_FASTCALL 0x80
314  #endif
315  typedef PyObject *(*__Pyx_PyCFunctionFast) (PyObject *self, PyObject *const *args, Py_ssize_t nargs);
316  typedef PyObject *(*__Pyx_PyCFunctionFastWithKeywords) (PyObject *self, PyObject *const *args,
317  Py_ssize_t nargs, PyObject *kwnames);
318 #else
319  #define __Pyx_PyCFunctionFast _PyCFunctionFast
320  #define __Pyx_PyCFunctionFastWithKeywords _PyCFunctionFastWithKeywords
321 #endif
322 #if CYTHON_FAST_PYCCALL
323 #define __Pyx_PyFastCFunction_Check(func)\
324  ((PyCFunction_Check(func) && (METH_FASTCALL == (PyCFunction_GET_FLAGS(func) & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)))))
325 #else
326 #define __Pyx_PyFastCFunction_Check(func) 0
327 #endif
328 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Malloc)
329  #define PyObject_Malloc(s) PyMem_Malloc(s)
330  #define PyObject_Free(p) PyMem_Free(p)
331  #define PyObject_Realloc(p) PyMem_Realloc(p)
332 #endif
333 #if CYTHON_COMPILING_IN_PYSTON
334  #define __Pyx_PyCode_HasFreeVars(co) PyCode_HasFreeVars(co)
335  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) PyFrame_SetLineNumber(frame, lineno)
336 #else
337  #define __Pyx_PyCode_HasFreeVars(co) (PyCode_GetNumFree(co) > 0)
338  #define __Pyx_PyFrame_SetLineNumber(frame, lineno) (frame)->f_lineno = (lineno)
339 #endif
340 #if !CYTHON_FAST_THREAD_STATE || PY_VERSION_HEX < 0x02070000
341  #define __Pyx_PyThreadState_Current PyThreadState_GET()
342 #elif PY_VERSION_HEX >= 0x03060000
343  #define __Pyx_PyThreadState_Current _PyThreadState_UncheckedGet()
344 #elif PY_VERSION_HEX >= 0x03000000
345  #define __Pyx_PyThreadState_Current PyThreadState_GET()
346 #else
347  #define __Pyx_PyThreadState_Current _PyThreadState_Current
348 #endif
349 #if PY_VERSION_HEX < 0x030700A2 && !defined(PyThread_tss_create) && !defined(Py_tss_NEEDS_INIT)
350 #include "pythread.h"
351 #define Py_tss_NEEDS_INIT 0
352 typedef int Py_tss_t;
353 static CYTHON_INLINE int PyThread_tss_create(Py_tss_t *key) {
354  *key = PyThread_create_key();
355  return 0; // PyThread_create_key reports success always
356 }
357 static CYTHON_INLINE Py_tss_t * PyThread_tss_alloc(void) {
358  Py_tss_t *key = (Py_tss_t *)PyObject_Malloc(sizeof(Py_tss_t));
359  *key = Py_tss_NEEDS_INIT;
360  return key;
361 }
362 static CYTHON_INLINE void PyThread_tss_free(Py_tss_t *key) {
363  PyObject_Free(key);
364 }
365 static CYTHON_INLINE int PyThread_tss_is_created(Py_tss_t *key) {
366  return *key != Py_tss_NEEDS_INIT;
367 }
368 static CYTHON_INLINE void PyThread_tss_delete(Py_tss_t *key) {
369  PyThread_delete_key(*key);
370  *key = Py_tss_NEEDS_INIT;
371 }
372 static CYTHON_INLINE int PyThread_tss_set(Py_tss_t *key, void *value) {
373  return PyThread_set_key_value(*key, value);
374 }
375 static CYTHON_INLINE void * PyThread_tss_get(Py_tss_t *key) {
376  return PyThread_get_key_value(*key);
377 }
378 #endif // TSS (Thread Specific Storage) API
379 #if CYTHON_COMPILING_IN_CPYTHON || defined(_PyDict_NewPresized)
380 #define __Pyx_PyDict_NewPresized(n) ((n <= 8) ? PyDict_New() : _PyDict_NewPresized(n))
381 #else
382 #define __Pyx_PyDict_NewPresized(n) PyDict_New()
383 #endif
384 #if PY_MAJOR_VERSION >= 3 || CYTHON_FUTURE_DIVISION
385  #define __Pyx_PyNumber_Divide(x,y) PyNumber_TrueDivide(x,y)
386  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceTrueDivide(x,y)
387 #else
388  #define __Pyx_PyNumber_Divide(x,y) PyNumber_Divide(x,y)
389  #define __Pyx_PyNumber_InPlaceDivide(x,y) PyNumber_InPlaceDivide(x,y)
390 #endif
391 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1 && CYTHON_USE_UNICODE_INTERNALS
392 #define __Pyx_PyDict_GetItemStr(dict, name) _PyDict_GetItem_KnownHash(dict, name, ((PyASCIIObject *) name)->hash)
393 #else
394 #define __Pyx_PyDict_GetItemStr(dict, name) PyDict_GetItem(dict, name)
395 #endif
396 #if PY_VERSION_HEX > 0x03030000 && defined(PyUnicode_KIND)
397  #define CYTHON_PEP393_ENABLED 1
398  #define __Pyx_PyUnicode_READY(op) (likely(PyUnicode_IS_READY(op)) ?\
399  0 : _PyUnicode_Ready((PyObject *)(op)))
400  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_LENGTH(u)
401  #define __Pyx_PyUnicode_READ_CHAR(u, i) PyUnicode_READ_CHAR(u, i)
402  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) PyUnicode_MAX_CHAR_VALUE(u)
403  #define __Pyx_PyUnicode_KIND(u) PyUnicode_KIND(u)
404  #define __Pyx_PyUnicode_DATA(u) PyUnicode_DATA(u)
405  #define __Pyx_PyUnicode_READ(k, d, i) PyUnicode_READ(k, d, i)
406  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) PyUnicode_WRITE(k, d, i, ch)
407  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != (likely(PyUnicode_IS_READY(u)) ? PyUnicode_GET_LENGTH(u) : PyUnicode_GET_SIZE(u)))
408 #else
409  #define CYTHON_PEP393_ENABLED 0
410  #define PyUnicode_1BYTE_KIND 1
411  #define PyUnicode_2BYTE_KIND 2
412  #define PyUnicode_4BYTE_KIND 4
413  #define __Pyx_PyUnicode_READY(op) (0)
414  #define __Pyx_PyUnicode_GET_LENGTH(u) PyUnicode_GET_SIZE(u)
415  #define __Pyx_PyUnicode_READ_CHAR(u, i) ((Py_UCS4)(PyUnicode_AS_UNICODE(u)[i]))
416  #define __Pyx_PyUnicode_MAX_CHAR_VALUE(u) ((sizeof(Py_UNICODE) == 2) ? 65535 : 1114111)
417  #define __Pyx_PyUnicode_KIND(u) (sizeof(Py_UNICODE))
418  #define __Pyx_PyUnicode_DATA(u) ((void*)PyUnicode_AS_UNICODE(u))
419  #define __Pyx_PyUnicode_READ(k, d, i) ((void)(k), (Py_UCS4)(((Py_UNICODE*)d)[i]))
420  #define __Pyx_PyUnicode_WRITE(k, d, i, ch) (((void)(k)), ((Py_UNICODE*)d)[i] = ch)
421  #define __Pyx_PyUnicode_IS_TRUE(u) (0 != PyUnicode_GET_SIZE(u))
422 #endif
423 #if CYTHON_COMPILING_IN_PYPY
424  #define __Pyx_PyUnicode_Concat(a, b) PyNumber_Add(a, b)
425  #define __Pyx_PyUnicode_ConcatSafe(a, b) PyNumber_Add(a, b)
426 #else
427  #define __Pyx_PyUnicode_Concat(a, b) PyUnicode_Concat(a, b)
428  #define __Pyx_PyUnicode_ConcatSafe(a, b) ((unlikely((a) == Py_None) || unlikely((b) == Py_None)) ?\
429  PyNumber_Add(a, b) : __Pyx_PyUnicode_Concat(a, b))
430 #endif
431 #if CYTHON_COMPILING_IN_PYPY && !defined(PyUnicode_Contains)
432  #define PyUnicode_Contains(u, s) PySequence_Contains(u, s)
433 #endif
434 #if CYTHON_COMPILING_IN_PYPY && !defined(PyByteArray_Check)
435  #define PyByteArray_Check(obj) PyObject_TypeCheck(obj, &PyByteArray_Type)
436 #endif
437 #if CYTHON_COMPILING_IN_PYPY && !defined(PyObject_Format)
438  #define PyObject_Format(obj, fmt) PyObject_CallMethod(obj, "__format__", "O", fmt)
439 #endif
440 #define __Pyx_PyString_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : __Pyx_PyString_Format(a, b))
441 #define __Pyx_PyUnicode_FormatSafe(a, b) ((unlikely((a) == Py_None)) ? PyNumber_Remainder(a, b) : PyUnicode_Format(a, b))
442 #if PY_MAJOR_VERSION >= 3
443  #define __Pyx_PyString_Format(a, b) PyUnicode_Format(a, b)
444 #else
445  #define __Pyx_PyString_Format(a, b) PyString_Format(a, b)
446 #endif
447 #if PY_MAJOR_VERSION < 3 && !defined(PyObject_ASCII)
448  #define PyObject_ASCII(o) PyObject_Repr(o)
449 #endif
450 #if PY_MAJOR_VERSION >= 3
451  #define PyBaseString_Type PyUnicode_Type
452  #define PyStringObject PyUnicodeObject
453  #define PyString_Type PyUnicode_Type
454  #define PyString_Check PyUnicode_Check
455  #define PyString_CheckExact PyUnicode_CheckExact
456  #define PyObject_Unicode PyObject_Str
457 #endif
458 #if PY_MAJOR_VERSION >= 3
459  #define __Pyx_PyBaseString_Check(obj) PyUnicode_Check(obj)
460  #define __Pyx_PyBaseString_CheckExact(obj) PyUnicode_CheckExact(obj)
461 #else
462  #define __Pyx_PyBaseString_Check(obj) (PyString_Check(obj) || PyUnicode_Check(obj))
463  #define __Pyx_PyBaseString_CheckExact(obj) (PyString_CheckExact(obj) || PyUnicode_CheckExact(obj))
464 #endif
465 #ifndef PySet_CheckExact
466  #define PySet_CheckExact(obj) (Py_TYPE(obj) == &PySet_Type)
467 #endif
468 #if CYTHON_ASSUME_SAFE_MACROS
469  #define __Pyx_PySequence_SIZE(seq) Py_SIZE(seq)
470 #else
471  #define __Pyx_PySequence_SIZE(seq) PySequence_Size(seq)
472 #endif
473 #if PY_MAJOR_VERSION >= 3
474  #define PyIntObject PyLongObject
475  #define PyInt_Type PyLong_Type
476  #define PyInt_Check(op) PyLong_Check(op)
477  #define PyInt_CheckExact(op) PyLong_CheckExact(op)
478  #define PyInt_FromString PyLong_FromString
479  #define PyInt_FromUnicode PyLong_FromUnicode
480  #define PyInt_FromLong PyLong_FromLong
481  #define PyInt_FromSize_t PyLong_FromSize_t
482  #define PyInt_FromSsize_t PyLong_FromSsize_t
483  #define PyInt_AsLong PyLong_AsLong
484  #define PyInt_AS_LONG PyLong_AS_LONG
485  #define PyInt_AsSsize_t PyLong_AsSsize_t
486  #define PyInt_AsUnsignedLongMask PyLong_AsUnsignedLongMask
487  #define PyInt_AsUnsignedLongLongMask PyLong_AsUnsignedLongLongMask
488  #define PyNumber_Int PyNumber_Long
489 #endif
490 #if PY_MAJOR_VERSION >= 3
491  #define PyBoolObject PyLongObject
492 #endif
493 #if PY_MAJOR_VERSION >= 3 && CYTHON_COMPILING_IN_PYPY
494  #ifndef PyUnicode_InternFromString
495  #define PyUnicode_InternFromString(s) PyUnicode_FromString(s)
496  #endif
497 #endif
498 #if PY_VERSION_HEX < 0x030200A4
499  typedef long Py_hash_t;
500  #define __Pyx_PyInt_FromHash_t PyInt_FromLong
501  #define __Pyx_PyInt_AsHash_t PyInt_AsLong
502 #else
503  #define __Pyx_PyInt_FromHash_t PyInt_FromSsize_t
504  #define __Pyx_PyInt_AsHash_t PyInt_AsSsize_t
505 #endif
506 #if PY_MAJOR_VERSION >= 3
507  #define __Pyx_PyMethod_New(func, self, klass) ((self) ? PyMethod_New(func, self) : (Py_INCREF(func), func))
508 #else
509  #define __Pyx_PyMethod_New(func, self, klass) PyMethod_New(func, self, klass)
510 #endif
511 #if CYTHON_USE_ASYNC_SLOTS
512  #if PY_VERSION_HEX >= 0x030500B1
513  #define __Pyx_PyAsyncMethodsStruct PyAsyncMethods
514  #define __Pyx_PyType_AsAsync(obj) (Py_TYPE(obj)->tp_as_async)
515  #else
516  #define __Pyx_PyType_AsAsync(obj) ((__Pyx_PyAsyncMethodsStruct*) (Py_TYPE(obj)->tp_reserved))
517  #endif
518 #else
519  #define __Pyx_PyType_AsAsync(obj) NULL
520 #endif
521 #ifndef __Pyx_PyAsyncMethodsStruct
522  typedef struct {
523  unaryfunc am_await;
524  unaryfunc am_aiter;
525  unaryfunc am_anext;
526  } __Pyx_PyAsyncMethodsStruct;
527 #endif
528 
529 #if defined(WIN32) || defined(MS_WINDOWS)
530  #define _USE_MATH_DEFINES
531 #endif
532 #include <math.h>
533 #ifdef NAN
534 #define __PYX_NAN() ((float) NAN)
535 #else
536 static CYTHON_INLINE float __PYX_NAN() {
537  float value;
538  memset(&value, 0xFF, sizeof(value));
539  return value;
540 }
541 #endif
542 #if defined(__CYGWIN__) && defined(_LDBL_EQ_DBL)
543 #define __Pyx_truncl trunc
544 #else
545 #define __Pyx_truncl truncl
546 #endif
547 
548 
549 #define __PYX_ERR(f_index, lineno, Ln_error) \
550 { \
551  __pyx_filename = __pyx_f[f_index]; __pyx_lineno = lineno; __pyx_clineno = __LINE__; goto Ln_error; \
552 }
553 
554 #ifndef __PYX_EXTERN_C
555  #ifdef __cplusplus
556  #define __PYX_EXTERN_C extern "C"
557  #else
558  #define __PYX_EXTERN_C extern
559  #endif
560 #endif
561 
562 #define __PYX_HAVE__BoundaryConditions
563 #define __PYX_HAVE_API__BoundaryConditions
564 /* Early includes */
565 #include <string.h>
566 #include <stdio.h>
567 #include "numpy/arrayobject.h"
568 #include "numpy/ufuncobject.h"
569 #include "pythread.h"
570 #include <stdlib.h>
571 #include "pystate.h"
572 #ifdef _OPENMP
573 #include <omp.h>
574 #endif /* _OPENMP */
575 
576 #if defined(PYREX_WITHOUT_ASSERTIONS) && !defined(CYTHON_WITHOUT_ASSERTIONS)
577 #define CYTHON_WITHOUT_ASSERTIONS
578 #endif
579 
580 typedef struct {PyObject **p; const char *s; const Py_ssize_t n; const char* encoding;
581  const char is_unicode; const char is_str; const char intern; } __Pyx_StringTabEntry;
582 
583 #define __PYX_DEFAULT_STRING_ENCODING_IS_ASCII 0
584 #define __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT 0
585 #define __PYX_DEFAULT_STRING_ENCODING ""
586 #define __Pyx_PyObject_FromString __Pyx_PyBytes_FromString
587 #define __Pyx_PyObject_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
588 #define __Pyx_uchar_cast(c) ((unsigned char)c)
589 #define __Pyx_long_cast(x) ((long)x)
590 #define __Pyx_fits_Py_ssize_t(v, type, is_signed) (\
591  (sizeof(type) < sizeof(Py_ssize_t)) ||\
592  (sizeof(type) > sizeof(Py_ssize_t) &&\
593  likely(v < (type)PY_SSIZE_T_MAX ||\
594  v == (type)PY_SSIZE_T_MAX) &&\
595  (!is_signed || likely(v > (type)PY_SSIZE_T_MIN ||\
596  v == (type)PY_SSIZE_T_MIN))) ||\
597  (sizeof(type) == sizeof(Py_ssize_t) &&\
598  (is_signed || likely(v < (type)PY_SSIZE_T_MAX ||\
599  v == (type)PY_SSIZE_T_MAX))) )
600 #if defined (__cplusplus) && __cplusplus >= 201103L
601  #include <cstdlib>
602  #define __Pyx_sst_abs(value) std::abs(value)
603 #elif SIZEOF_INT >= SIZEOF_SIZE_T
604  #define __Pyx_sst_abs(value) abs(value)
605 #elif SIZEOF_LONG >= SIZEOF_SIZE_T
606  #define __Pyx_sst_abs(value) labs(value)
607 #elif defined (_MSC_VER)
608  #define __Pyx_sst_abs(value) ((Py_ssize_t)_abs64(value))
609 #elif defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L
610  #define __Pyx_sst_abs(value) llabs(value)
611 #elif defined (__GNUC__)
612  #define __Pyx_sst_abs(value) __builtin_llabs(value)
613 #else
614  #define __Pyx_sst_abs(value) ((value<0) ? -value : value)
615 #endif
616 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject*);
617 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject*, Py_ssize_t* length);
618 #define __Pyx_PyByteArray_FromString(s) PyByteArray_FromStringAndSize((const char*)s, strlen((const char*)s))
619 #define __Pyx_PyByteArray_FromStringAndSize(s, l) PyByteArray_FromStringAndSize((const char*)s, l)
620 #define __Pyx_PyBytes_FromString PyBytes_FromString
621 #define __Pyx_PyBytes_FromStringAndSize PyBytes_FromStringAndSize
622 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char*);
623 #if PY_MAJOR_VERSION < 3
624  #define __Pyx_PyStr_FromString __Pyx_PyBytes_FromString
625  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyBytes_FromStringAndSize
626 #else
627  #define __Pyx_PyStr_FromString __Pyx_PyUnicode_FromString
628  #define __Pyx_PyStr_FromStringAndSize __Pyx_PyUnicode_FromStringAndSize
629 #endif
630 #define __Pyx_PyBytes_AsWritableString(s) ((char*) PyBytes_AS_STRING(s))
631 #define __Pyx_PyBytes_AsWritableSString(s) ((signed char*) PyBytes_AS_STRING(s))
632 #define __Pyx_PyBytes_AsWritableUString(s) ((unsigned char*) PyBytes_AS_STRING(s))
633 #define __Pyx_PyBytes_AsString(s) ((const char*) PyBytes_AS_STRING(s))
634 #define __Pyx_PyBytes_AsSString(s) ((const signed char*) PyBytes_AS_STRING(s))
635 #define __Pyx_PyBytes_AsUString(s) ((const unsigned char*) PyBytes_AS_STRING(s))
636 #define __Pyx_PyObject_AsWritableString(s) ((char*) __Pyx_PyObject_AsString(s))
637 #define __Pyx_PyObject_AsWritableSString(s) ((signed char*) __Pyx_PyObject_AsString(s))
638 #define __Pyx_PyObject_AsWritableUString(s) ((unsigned char*) __Pyx_PyObject_AsString(s))
639 #define __Pyx_PyObject_AsSString(s) ((const signed char*) __Pyx_PyObject_AsString(s))
640 #define __Pyx_PyObject_AsUString(s) ((const unsigned char*) __Pyx_PyObject_AsString(s))
641 #define __Pyx_PyObject_FromCString(s) __Pyx_PyObject_FromString((const char*)s)
642 #define __Pyx_PyBytes_FromCString(s) __Pyx_PyBytes_FromString((const char*)s)
643 #define __Pyx_PyByteArray_FromCString(s) __Pyx_PyByteArray_FromString((const char*)s)
644 #define __Pyx_PyStr_FromCString(s) __Pyx_PyStr_FromString((const char*)s)
645 #define __Pyx_PyUnicode_FromCString(s) __Pyx_PyUnicode_FromString((const char*)s)
646 static CYTHON_INLINE size_t __Pyx_Py_UNICODE_strlen(const Py_UNICODE *u) {
647  const Py_UNICODE *u_end = u;
648  while (*u_end++) ;
649  return (size_t)(u_end - u - 1);
650 }
651 #define __Pyx_PyUnicode_FromUnicode(u) PyUnicode_FromUnicode(u, __Pyx_Py_UNICODE_strlen(u))
652 #define __Pyx_PyUnicode_FromUnicodeAndLength PyUnicode_FromUnicode
653 #define __Pyx_PyUnicode_AsUnicode PyUnicode_AsUnicode
654 #define __Pyx_NewRef(obj) (Py_INCREF(obj), obj)
655 #define __Pyx_Owned_Py_None(b) __Pyx_NewRef(Py_None)
656 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b);
657 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject*);
658 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x);
659 #define __Pyx_PySequence_Tuple(obj)\
660  (likely(PyTuple_CheckExact(obj)) ? __Pyx_NewRef(obj) : PySequence_Tuple(obj))
661 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject*);
662 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t);
663 #if CYTHON_ASSUME_SAFE_MACROS
664 #define __pyx_PyFloat_AsDouble(x) (PyFloat_CheckExact(x) ? PyFloat_AS_DOUBLE(x) : PyFloat_AsDouble(x))
665 #else
666 #define __pyx_PyFloat_AsDouble(x) PyFloat_AsDouble(x)
667 #endif
668 #define __pyx_PyFloat_AsFloat(x) ((float) __pyx_PyFloat_AsDouble(x))
669 #if PY_MAJOR_VERSION >= 3
670 #define __Pyx_PyNumber_Int(x) (PyLong_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Long(x))
671 #else
672 #define __Pyx_PyNumber_Int(x) (PyInt_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Int(x))
673 #endif
674 #define __Pyx_PyNumber_Float(x) (PyFloat_CheckExact(x) ? __Pyx_NewRef(x) : PyNumber_Float(x))
675 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
676 static int __Pyx_sys_getdefaultencoding_not_ascii;
677 static int __Pyx_init_sys_getdefaultencoding_params(void) {
678  PyObject* sys;
679  PyObject* default_encoding = NULL;
680  PyObject* ascii_chars_u = NULL;
681  PyObject* ascii_chars_b = NULL;
682  const char* default_encoding_c;
683  sys = PyImport_ImportModule("sys");
684  if (!sys) goto bad;
685  default_encoding = PyObject_CallMethod(sys, (char*) "getdefaultencoding", NULL);
686  Py_DECREF(sys);
687  if (!default_encoding) goto bad;
688  default_encoding_c = PyBytes_AsString(default_encoding);
689  if (!default_encoding_c) goto bad;
690  if (strcmp(default_encoding_c, "ascii") == 0) {
691  __Pyx_sys_getdefaultencoding_not_ascii = 0;
692  } else {
693  char ascii_chars[128];
694  int c;
695  for (c = 0; c < 128; c++) {
696  ascii_chars[c] = c;
697  }
698  __Pyx_sys_getdefaultencoding_not_ascii = 1;
699  ascii_chars_u = PyUnicode_DecodeASCII(ascii_chars, 128, NULL);
700  if (!ascii_chars_u) goto bad;
701  ascii_chars_b = PyUnicode_AsEncodedString(ascii_chars_u, default_encoding_c, NULL);
702  if (!ascii_chars_b || !PyBytes_Check(ascii_chars_b) || memcmp(ascii_chars, PyBytes_AS_STRING(ascii_chars_b), 128) != 0) {
703  PyErr_Format(
704  PyExc_ValueError,
705  "This module compiled with c_string_encoding=ascii, but default encoding '%.200s' is not a superset of ascii.",
706  default_encoding_c);
707  goto bad;
708  }
709  Py_DECREF(ascii_chars_u);
710  Py_DECREF(ascii_chars_b);
711  }
712  Py_DECREF(default_encoding);
713  return 0;
714 bad:
715  Py_XDECREF(default_encoding);
716  Py_XDECREF(ascii_chars_u);
717  Py_XDECREF(ascii_chars_b);
718  return -1;
719 }
720 #endif
721 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT && PY_MAJOR_VERSION >= 3
722 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_DecodeUTF8(c_str, size, NULL)
723 #else
724 #define __Pyx_PyUnicode_FromStringAndSize(c_str, size) PyUnicode_Decode(c_str, size, __PYX_DEFAULT_STRING_ENCODING, NULL)
725 #if __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
726 static char* __PYX_DEFAULT_STRING_ENCODING;
727 static int __Pyx_init_sys_getdefaultencoding_params(void) {
728  PyObject* sys;
729  PyObject* default_encoding = NULL;
730  char* default_encoding_c;
731  sys = PyImport_ImportModule("sys");
732  if (!sys) goto bad;
733  default_encoding = PyObject_CallMethod(sys, (char*) (const char*) "getdefaultencoding", NULL);
734  Py_DECREF(sys);
735  if (!default_encoding) goto bad;
736  default_encoding_c = PyBytes_AsString(default_encoding);
737  if (!default_encoding_c) goto bad;
738  __PYX_DEFAULT_STRING_ENCODING = (char*) malloc(strlen(default_encoding_c));
739  if (!__PYX_DEFAULT_STRING_ENCODING) goto bad;
740  strcpy(__PYX_DEFAULT_STRING_ENCODING, default_encoding_c);
741  Py_DECREF(default_encoding);
742  return 0;
743 bad:
744  Py_XDECREF(default_encoding);
745  return -1;
746 }
747 #endif
748 #endif
749 
750 
751 /* Test for GCC > 2.95 */
752 #if defined(__GNUC__) && (__GNUC__ > 2 || (__GNUC__ == 2 && (__GNUC_MINOR__ > 95)))
753  #define likely(x) __builtin_expect(!!(x), 1)
754  #define unlikely(x) __builtin_expect(!!(x), 0)
755 #else /* !__GNUC__ or GCC < 2.95 */
756  #define likely(x) (x)
757  #define unlikely(x) (x)
758 #endif /* __GNUC__ */
759 static CYTHON_INLINE void __Pyx_pretend_to_initialize(void* ptr) { (void)ptr; }
760 
761 static PyObject *__pyx_m = NULL;
762 static PyObject *__pyx_d;
763 static PyObject *__pyx_b;
764 static PyObject *__pyx_cython_runtime = NULL;
765 static PyObject *__pyx_empty_tuple;
766 static PyObject *__pyx_empty_bytes;
767 static PyObject *__pyx_empty_unicode;
768 static int __pyx_lineno;
769 static int __pyx_clineno = 0;
770 static const char * __pyx_cfilenm= __FILE__;
771 static const char *__pyx_filename;
772 
773 /* Header.proto */
774 #if !defined(CYTHON_CCOMPLEX)
775  #if defined(__cplusplus)
776  #define CYTHON_CCOMPLEX 1
777  #elif defined(_Complex_I)
778  #define CYTHON_CCOMPLEX 1
779  #else
780  #define CYTHON_CCOMPLEX 0
781  #endif
782 #endif
783 #if CYTHON_CCOMPLEX
784  #ifdef __cplusplus
785  #include <complex>
786  #else
787  #include <complex.h>
788  #endif
789 #endif
790 #if CYTHON_CCOMPLEX && !defined(__cplusplus) && defined(__sun__) && defined(__GNUC__)
791  #undef _Complex_I
792  #define _Complex_I 1.0fj
793 #endif
794 
795 
796 static const char *__pyx_f[] = {
797  "stringsource",
798  "proteus/BoundaryConditions.py",
799  "proteus/BoundaryConditions.pxd",
800  "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd",
801  "linux2/lib/python2.7/site-packages/Cython/Includes/cpython/type.pxd",
802 };
803 /* MemviewSliceStruct.proto */
804 struct __pyx_memoryview_obj;
805 typedef struct {
806  struct __pyx_memoryview_obj *memview;
807  char *data;
808  Py_ssize_t shape[8];
809  Py_ssize_t strides[8];
810  Py_ssize_t suboffsets[8];
811 } __Pyx_memviewslice;
812 #define __Pyx_MemoryView_Len(m) (m.shape[0])
813 
814 /* Atomics.proto */
815 #include <pythread.h>
816 #ifndef CYTHON_ATOMICS
817  #define CYTHON_ATOMICS 1
818 #endif
819 #define __pyx_atomic_int_type int
820 #if CYTHON_ATOMICS && __GNUC__ >= 4 && (__GNUC_MINOR__ > 1 ||\
821  (__GNUC_MINOR__ == 1 && __GNUC_PATCHLEVEL >= 2)) &&\
822  !defined(__i386__)
823  #define __pyx_atomic_incr_aligned(value, lock) __sync_fetch_and_add(value, 1)
824  #define __pyx_atomic_decr_aligned(value, lock) __sync_fetch_and_sub(value, 1)
825  #ifdef __PYX_DEBUG_ATOMICS
826  #warning "Using GNU atomics"
827  #endif
828 #elif CYTHON_ATOMICS && defined(_MSC_VER) && 0
829  #include <Windows.h>
830  #undef __pyx_atomic_int_type
831  #define __pyx_atomic_int_type LONG
832  #define __pyx_atomic_incr_aligned(value, lock) InterlockedIncrement(value)
833  #define __pyx_atomic_decr_aligned(value, lock) InterlockedDecrement(value)
834  #ifdef __PYX_DEBUG_ATOMICS
835  #pragma message ("Using MSVC atomics")
836  #endif
837 #elif CYTHON_ATOMICS && (defined(__ICC) || defined(__INTEL_COMPILER)) && 0
838  #define __pyx_atomic_incr_aligned(value, lock) _InterlockedIncrement(value)
839  #define __pyx_atomic_decr_aligned(value, lock) _InterlockedDecrement(value)
840  #ifdef __PYX_DEBUG_ATOMICS
841  #warning "Using Intel atomics"
842  #endif
843 #else
844  #undef CYTHON_ATOMICS
845  #define CYTHON_ATOMICS 0
846  #ifdef __PYX_DEBUG_ATOMICS
847  #warning "Not using atomics"
848  #endif
849 #endif
850 typedef volatile __pyx_atomic_int_type __pyx_atomic_int;
851 #if CYTHON_ATOMICS
852  #define __pyx_add_acquisition_count(memview)\
853  __pyx_atomic_incr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
854  #define __pyx_sub_acquisition_count(memview)\
855  __pyx_atomic_decr_aligned(__pyx_get_slice_count_pointer(memview), memview->lock)
856 #else
857  #define __pyx_add_acquisition_count(memview)\
858  __pyx_add_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
859  #define __pyx_sub_acquisition_count(memview)\
860  __pyx_sub_acquisition_count_locked(__pyx_get_slice_count_pointer(memview), memview->lock)
861 #endif
862 
863 /* ForceInitThreads.proto */
864 #ifndef __PYX_FORCE_INIT_THREADS
865  #define __PYX_FORCE_INIT_THREADS 0
866 #endif
867 
868 /* NoFastGil.proto */
869 #define __Pyx_PyGILState_Ensure PyGILState_Ensure
870 #define __Pyx_PyGILState_Release PyGILState_Release
871 #define __Pyx_FastGIL_Remember()
872 #define __Pyx_FastGIL_Forget()
873 #define __Pyx_FastGilFuncInit()
874 
875 /* BufferFormatStructs.proto */
876 #define IS_UNSIGNED(type) (((type) -1) > 0)
877 struct __Pyx_StructField_;
878 #define __PYX_BUF_FLAGS_PACKED_STRUCT (1 << 0)
879 typedef struct {
880  const char* name;
881  struct __Pyx_StructField_* fields;
882  size_t size;
883  size_t arraysize[8];
884  int ndim;
885  char typegroup;
886  char is_unsigned;
887  int flags;
888 } __Pyx_TypeInfo;
889 typedef struct __Pyx_StructField_ {
890  __Pyx_TypeInfo* type;
891  const char* name;
892  size_t offset;
893 } __Pyx_StructField;
894 typedef struct {
895  __Pyx_StructField* field;
896  size_t parent_offset;
897 } __Pyx_BufFmt_StackElem;
898 typedef struct {
899  __Pyx_StructField root;
900  __Pyx_BufFmt_StackElem* head;
901  size_t fmt_offset;
902  size_t new_count, enc_count;
903  size_t struct_alignment;
904  int is_complex;
905  char enc_type;
906  char new_packmode;
907  char enc_packmode;
908  char is_valid_array;
909 } __Pyx_BufFmt_Context;
910 
911 
912 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":730
913  * # in Cython to enable them only on the right systems.
914  *
915  * ctypedef npy_int8 int8_t # <<<<<<<<<<<<<<
916  * ctypedef npy_int16 int16_t
917  * ctypedef npy_int32 int32_t
918  */
919 typedef npy_int8 __pyx_t_5numpy_int8_t;
920 
921 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":731
922  *
923  * ctypedef npy_int8 int8_t
924  * ctypedef npy_int16 int16_t # <<<<<<<<<<<<<<
925  * ctypedef npy_int32 int32_t
926  * ctypedef npy_int64 int64_t
927  */
928 typedef npy_int16 __pyx_t_5numpy_int16_t;
929 
930 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":732
931  * ctypedef npy_int8 int8_t
932  * ctypedef npy_int16 int16_t
933  * ctypedef npy_int32 int32_t # <<<<<<<<<<<<<<
934  * ctypedef npy_int64 int64_t
935  * #ctypedef npy_int96 int96_t
936  */
937 typedef npy_int32 __pyx_t_5numpy_int32_t;
938 
939 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":733
940  * ctypedef npy_int16 int16_t
941  * ctypedef npy_int32 int32_t
942  * ctypedef npy_int64 int64_t # <<<<<<<<<<<<<<
943  * #ctypedef npy_int96 int96_t
944  * #ctypedef npy_int128 int128_t
945  */
946 typedef npy_int64 __pyx_t_5numpy_int64_t;
947 
948 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":737
949  * #ctypedef npy_int128 int128_t
950  *
951  * ctypedef npy_uint8 uint8_t # <<<<<<<<<<<<<<
952  * ctypedef npy_uint16 uint16_t
953  * ctypedef npy_uint32 uint32_t
954  */
955 typedef npy_uint8 __pyx_t_5numpy_uint8_t;
956 
957 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":738
958  *
959  * ctypedef npy_uint8 uint8_t
960  * ctypedef npy_uint16 uint16_t # <<<<<<<<<<<<<<
961  * ctypedef npy_uint32 uint32_t
962  * ctypedef npy_uint64 uint64_t
963  */
964 typedef npy_uint16 __pyx_t_5numpy_uint16_t;
965 
966 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":739
967  * ctypedef npy_uint8 uint8_t
968  * ctypedef npy_uint16 uint16_t
969  * ctypedef npy_uint32 uint32_t # <<<<<<<<<<<<<<
970  * ctypedef npy_uint64 uint64_t
971  * #ctypedef npy_uint96 uint96_t
972  */
973 typedef npy_uint32 __pyx_t_5numpy_uint32_t;
974 
975 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":740
976  * ctypedef npy_uint16 uint16_t
977  * ctypedef npy_uint32 uint32_t
978  * ctypedef npy_uint64 uint64_t # <<<<<<<<<<<<<<
979  * #ctypedef npy_uint96 uint96_t
980  * #ctypedef npy_uint128 uint128_t
981  */
982 typedef npy_uint64 __pyx_t_5numpy_uint64_t;
983 
984 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":744
985  * #ctypedef npy_uint128 uint128_t
986  *
987  * ctypedef npy_float32 float32_t # <<<<<<<<<<<<<<
988  * ctypedef npy_float64 float64_t
989  * #ctypedef npy_float80 float80_t
990  */
991 typedef npy_float32 __pyx_t_5numpy_float32_t;
992 
993 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":745
994  *
995  * ctypedef npy_float32 float32_t
996  * ctypedef npy_float64 float64_t # <<<<<<<<<<<<<<
997  * #ctypedef npy_float80 float80_t
998  * #ctypedef npy_float128 float128_t
999  */
1000 typedef npy_float64 __pyx_t_5numpy_float64_t;
1001 
1002 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":754
1003  * # The int types are mapped a bit surprising --
1004  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1005  * ctypedef npy_long int_t # <<<<<<<<<<<<<<
1006  * ctypedef npy_longlong long_t
1007  * ctypedef npy_longlong longlong_t
1008  */
1009 typedef npy_long __pyx_t_5numpy_int_t;
1010 
1011 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":755
1012  * # numpy.int corresponds to 'l' and numpy.long to 'q'
1013  * ctypedef npy_long int_t
1014  * ctypedef npy_longlong long_t # <<<<<<<<<<<<<<
1015  * ctypedef npy_longlong longlong_t
1016  *
1017  */
1018 typedef npy_longlong __pyx_t_5numpy_long_t;
1019 
1020 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":756
1021  * ctypedef npy_long int_t
1022  * ctypedef npy_longlong long_t
1023  * ctypedef npy_longlong longlong_t # <<<<<<<<<<<<<<
1024  *
1025  * ctypedef npy_ulong uint_t
1026  */
1027 typedef npy_longlong __pyx_t_5numpy_longlong_t;
1028 
1029 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":758
1030  * ctypedef npy_longlong longlong_t
1031  *
1032  * ctypedef npy_ulong uint_t # <<<<<<<<<<<<<<
1033  * ctypedef npy_ulonglong ulong_t
1034  * ctypedef npy_ulonglong ulonglong_t
1035  */
1036 typedef npy_ulong __pyx_t_5numpy_uint_t;
1037 
1038 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":759
1039  *
1040  * ctypedef npy_ulong uint_t
1041  * ctypedef npy_ulonglong ulong_t # <<<<<<<<<<<<<<
1042  * ctypedef npy_ulonglong ulonglong_t
1043  *
1044  */
1045 typedef npy_ulonglong __pyx_t_5numpy_ulong_t;
1046 
1047 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":760
1048  * ctypedef npy_ulong uint_t
1049  * ctypedef npy_ulonglong ulong_t
1050  * ctypedef npy_ulonglong ulonglong_t # <<<<<<<<<<<<<<
1051  *
1052  * ctypedef npy_intp intp_t
1053  */
1054 typedef npy_ulonglong __pyx_t_5numpy_ulonglong_t;
1055 
1056 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":762
1057  * ctypedef npy_ulonglong ulonglong_t
1058  *
1059  * ctypedef npy_intp intp_t # <<<<<<<<<<<<<<
1060  * ctypedef npy_uintp uintp_t
1061  *
1062  */
1063 typedef npy_intp __pyx_t_5numpy_intp_t;
1064 
1065 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":763
1066  *
1067  * ctypedef npy_intp intp_t
1068  * ctypedef npy_uintp uintp_t # <<<<<<<<<<<<<<
1069  *
1070  * ctypedef npy_double float_t
1071  */
1072 typedef npy_uintp __pyx_t_5numpy_uintp_t;
1073 
1074 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":765
1075  * ctypedef npy_uintp uintp_t
1076  *
1077  * ctypedef npy_double float_t # <<<<<<<<<<<<<<
1078  * ctypedef npy_double double_t
1079  * ctypedef npy_longdouble longdouble_t
1080  */
1081 typedef npy_double __pyx_t_5numpy_float_t;
1082 
1083 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":766
1084  *
1085  * ctypedef npy_double float_t
1086  * ctypedef npy_double double_t # <<<<<<<<<<<<<<
1087  * ctypedef npy_longdouble longdouble_t
1088  *
1089  */
1090 typedef npy_double __pyx_t_5numpy_double_t;
1091 
1092 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":767
1093  * ctypedef npy_double float_t
1094  * ctypedef npy_double double_t
1095  * ctypedef npy_longdouble longdouble_t # <<<<<<<<<<<<<<
1096  *
1097  * ctypedef npy_cfloat cfloat_t
1098  */
1099 typedef npy_longdouble __pyx_t_5numpy_longdouble_t;
1100 /* Declarations.proto */
1101 #if CYTHON_CCOMPLEX
1102  #ifdef __cplusplus
1103  typedef ::std::complex< float > __pyx_t_float_complex;
1104  #else
1105  typedef float _Complex __pyx_t_float_complex;
1106  #endif
1107 #else
1108  typedef struct { float real, imag; } __pyx_t_float_complex;
1109 #endif
1110 static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float, float);
1111 
1112 /* Declarations.proto */
1113 #if CYTHON_CCOMPLEX
1114  #ifdef __cplusplus
1115  typedef ::std::complex< double > __pyx_t_double_complex;
1116  #else
1117  typedef double _Complex __pyx_t_double_complex;
1118  #endif
1119 #else
1120  typedef struct { double real, imag; } __pyx_t_double_complex;
1121 #endif
1122 static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double, double);
1123 
1124 
1125 /*--- Type declarations ---*/
1126 struct __pyx_obj_18BoundaryConditions_BC_Base;
1127 struct __pyx_obj_18BoundaryConditions_BoundaryCondition;
1128 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC;
1129 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
1130 struct __pyx_array_obj;
1131 struct __pyx_MemviewEnum_obj;
1132 struct __pyx_memoryview_obj;
1133 struct __pyx_memoryviewslice_obj;
1134 
1135 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":769
1136  * ctypedef npy_longdouble longdouble_t
1137  *
1138  * ctypedef npy_cfloat cfloat_t # <<<<<<<<<<<<<<
1139  * ctypedef npy_cdouble cdouble_t
1140  * ctypedef npy_clongdouble clongdouble_t
1141  */
1142 typedef npy_cfloat __pyx_t_5numpy_cfloat_t;
1143 
1144 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":770
1145  *
1146  * ctypedef npy_cfloat cfloat_t
1147  * ctypedef npy_cdouble cdouble_t # <<<<<<<<<<<<<<
1148  * ctypedef npy_clongdouble clongdouble_t
1149  *
1150  */
1151 typedef npy_cdouble __pyx_t_5numpy_cdouble_t;
1152 
1153 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":771
1154  * ctypedef npy_cfloat cfloat_t
1155  * ctypedef npy_cdouble cdouble_t
1156  * ctypedef npy_clongdouble clongdouble_t # <<<<<<<<<<<<<<
1157  *
1158  * ctypedef npy_cdouble complex_t
1159  */
1160 typedef npy_clongdouble __pyx_t_5numpy_clongdouble_t;
1161 
1162 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":773
1163  * ctypedef npy_clongdouble clongdouble_t
1164  *
1165  * ctypedef npy_cdouble complex_t # <<<<<<<<<<<<<<
1166  *
1167  * cdef inline object PyArray_MultiIterNew1(a):
1168  */
1169 typedef npy_cdouble __pyx_t_5numpy_complex_t;
1170 
1171 /* "BoundaryConditions.pxd":16
1172  * # cpdef void getContext(BC_Base cls, object context=*)
1173  *
1174  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double) # <<<<<<<<<<<<<<
1175  * cdef class BoundaryCondition:
1176  * cdef cpp_uOfXT uuOfXT
1177  */
1178 typedef double (*__pyx_t_18BoundaryConditions_cpp_uOfXT)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, __Pyx_memviewslice, double);
1179 
1180 /* "BoundaryConditions.pxd":5
1181  * import cython
1182  *
1183  * cdef class BC_Base: # <<<<<<<<<<<<<<
1184  * cdef double[:] _b_or
1185  * cdef public:
1186  */
1187 struct __pyx_obj_18BoundaryConditions_BC_Base {
1188  PyObject_HEAD
1189  __Pyx_memviewslice _b_or;
1190  int nd;
1191  PyObject *Shape;
1192  PyObject *name;
1193  PyObject *BC_type;
1194  PyObject *ct;
1195 };
1196 
1197 
1198 /* "BoundaryConditions.pxd":17
1199  *
1200  * ctypedef double (*cpp_uOfXT) (BoundaryCondition, double[:], double)
1201  * cdef class BoundaryCondition: # <<<<<<<<<<<<<<
1202  * cdef cpp_uOfXT uuOfXT
1203  * cdef public:
1204  */
1205 struct __pyx_obj_18BoundaryConditions_BoundaryCondition {
1206  PyObject_HEAD
1207  struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtab;
1208  __pyx_t_18BoundaryConditions_cpp_uOfXT uuOfXT;
1209  PyObject *uOfXT;
1210 };
1211 
1212 
1213 /* "BoundaryConditions.py":76
1214  * self.uOfXT = None
1215  *
1216  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
1217  * """
1218  * function returning constant BC
1219  */
1220 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC {
1221  PyObject_HEAD
1222  PyObject *__pyx_v_value;
1223 };
1224 
1225 
1226 /* "BoundaryConditions.py":88
1227  *
1228  *
1229  * def setLinearBC(self, a0, a1, i): # <<<<<<<<<<<<<<
1230  * self.uOfXT = lambda x, t: a0+a1*x[i]
1231  */
1232 struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC {
1233  PyObject_HEAD
1234  PyObject *__pyx_v_a0;
1235  PyObject *__pyx_v_a1;
1236  PyObject *__pyx_v_i;
1237 };
1238 
1239 
1240 /* "View.MemoryView":104
1241  *
1242  * @cname("__pyx_array")
1243  * cdef class array: # <<<<<<<<<<<<<<
1244  *
1245  * cdef:
1246  */
1247 struct __pyx_array_obj {
1248  PyObject_HEAD
1249  struct __pyx_vtabstruct_array *__pyx_vtab;
1250  char *data;
1251  Py_ssize_t len;
1252  char *format;
1253  int ndim;
1254  Py_ssize_t *_shape;
1255  Py_ssize_t *_strides;
1256  Py_ssize_t itemsize;
1257  PyObject *mode;
1258  PyObject *_format;
1259  void (*callback_free_data)(void *);
1260  int free_data;
1261  int dtype_is_object;
1262 };
1263 
1264 
1265 /* "View.MemoryView":278
1266  *
1267  * @cname('__pyx_MemviewEnum')
1268  * cdef class Enum(object): # <<<<<<<<<<<<<<
1269  * cdef object name
1270  * def __init__(self, name):
1271  */
1272 struct __pyx_MemviewEnum_obj {
1273  PyObject_HEAD
1274  PyObject *name;
1275 };
1276 
1277 
1278 /* "View.MemoryView":329
1279  *
1280  * @cname('__pyx_memoryview')
1281  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1282  *
1283  * cdef object obj
1284  */
1285 struct __pyx_memoryview_obj {
1286  PyObject_HEAD
1287  struct __pyx_vtabstruct_memoryview *__pyx_vtab;
1288  PyObject *obj;
1289  PyObject *_size;
1290  PyObject *_array_interface;
1291  PyThread_type_lock lock;
1292  __pyx_atomic_int acquisition_count[2];
1293  __pyx_atomic_int *acquisition_count_aligned_p;
1294  Py_buffer view;
1295  int flags;
1296  int dtype_is_object;
1297  __Pyx_TypeInfo *typeinfo;
1298 };
1299 
1300 
1301 /* "View.MemoryView":960
1302  *
1303  * @cname('__pyx_memoryviewslice')
1304  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1305  * "Internal class for passing memoryview slices to Python"
1306  *
1307  */
1308 struct __pyx_memoryviewslice_obj {
1309  struct __pyx_memoryview_obj __pyx_base;
1310  __Pyx_memviewslice from_slice;
1311  PyObject *from_object;
1312  PyObject *(*to_object_func)(char *);
1313  int (*to_dtype_func)(char *, PyObject *);
1314 };
1315 
1316 
1317 
1318 /* "BoundaryConditions.py":57
1319  *
1320  *
1321  * class BoundaryCondition(): # <<<<<<<<<<<<<<
1322  * """
1323  * Boundary condition class
1324  */
1325 
1326 struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition {
1327  void (*resetBC)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch);
1328 };
1329 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition *__pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
1330 
1331 
1332 /* "View.MemoryView":104
1333  *
1334  * @cname("__pyx_array")
1335  * cdef class array: # <<<<<<<<<<<<<<
1336  *
1337  * cdef:
1338  */
1339 
1340 struct __pyx_vtabstruct_array {
1341  PyObject *(*get_memview)(struct __pyx_array_obj *);
1342 };
1343 static struct __pyx_vtabstruct_array *__pyx_vtabptr_array;
1344 
1345 
1346 /* "View.MemoryView":329
1347  *
1348  * @cname('__pyx_memoryview')
1349  * cdef class memoryview(object): # <<<<<<<<<<<<<<
1350  *
1351  * cdef object obj
1352  */
1353 
1354 struct __pyx_vtabstruct_memoryview {
1355  char *(*get_item_pointer)(struct __pyx_memoryview_obj *, PyObject *);
1356  PyObject *(*is_slice)(struct __pyx_memoryview_obj *, PyObject *);
1357  PyObject *(*setitem_slice_assignment)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1358  PyObject *(*setitem_slice_assign_scalar)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *);
1359  PyObject *(*setitem_indexed)(struct __pyx_memoryview_obj *, PyObject *, PyObject *);
1360  PyObject *(*convert_item_to_object)(struct __pyx_memoryview_obj *, char *);
1361  PyObject *(*assign_item_from_object)(struct __pyx_memoryview_obj *, char *, PyObject *);
1362 };
1363 static struct __pyx_vtabstruct_memoryview *__pyx_vtabptr_memoryview;
1364 
1365 
1366 /* "View.MemoryView":960
1367  *
1368  * @cname('__pyx_memoryviewslice')
1369  * cdef class _memoryviewslice(memoryview): # <<<<<<<<<<<<<<
1370  * "Internal class for passing memoryview slices to Python"
1371  *
1372  */
1373 
1374 struct __pyx_vtabstruct__memoryviewslice {
1375  struct __pyx_vtabstruct_memoryview __pyx_base;
1376 };
1377 static struct __pyx_vtabstruct__memoryviewslice *__pyx_vtabptr__memoryviewslice;
1378 
1379 /* --- Runtime support code (head) --- */
1380 /* Refnanny.proto */
1381 #ifndef CYTHON_REFNANNY
1382  #define CYTHON_REFNANNY 0
1383 #endif
1384 #if CYTHON_REFNANNY
1385  typedef struct {
1386  void (*INCREF)(void*, PyObject*, int);
1387  void (*DECREF)(void*, PyObject*, int);
1388  void (*GOTREF)(void*, PyObject*, int);
1389  void (*GIVEREF)(void*, PyObject*, int);
1390  void* (*SetupContext)(const char*, int, const char*);
1391  void (*FinishContext)(void**);
1392  } __Pyx_RefNannyAPIStruct;
1393  static __Pyx_RefNannyAPIStruct *__Pyx_RefNanny = NULL;
1394  static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname);
1395  #define __Pyx_RefNannyDeclarations void *__pyx_refnanny = NULL;
1396 #ifdef WITH_THREAD
1397  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1398  if (acquire_gil) {\
1399  PyGILState_STATE __pyx_gilstate_save = PyGILState_Ensure();\
1400  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1401  PyGILState_Release(__pyx_gilstate_save);\
1402  } else {\
1403  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__);\
1404  }
1405 #else
1406  #define __Pyx_RefNannySetupContext(name, acquire_gil)\
1407  __pyx_refnanny = __Pyx_RefNanny->SetupContext((name), __LINE__, __FILE__)
1408 #endif
1409  #define __Pyx_RefNannyFinishContext()\
1410  __Pyx_RefNanny->FinishContext(&__pyx_refnanny)
1411  #define __Pyx_INCREF(r) __Pyx_RefNanny->INCREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1412  #define __Pyx_DECREF(r) __Pyx_RefNanny->DECREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1413  #define __Pyx_GOTREF(r) __Pyx_RefNanny->GOTREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1414  #define __Pyx_GIVEREF(r) __Pyx_RefNanny->GIVEREF(__pyx_refnanny, (PyObject *)(r), __LINE__)
1415  #define __Pyx_XINCREF(r) do { if((r) != NULL) {__Pyx_INCREF(r); }} while(0)
1416  #define __Pyx_XDECREF(r) do { if((r) != NULL) {__Pyx_DECREF(r); }} while(0)
1417  #define __Pyx_XGOTREF(r) do { if((r) != NULL) {__Pyx_GOTREF(r); }} while(0)
1418  #define __Pyx_XGIVEREF(r) do { if((r) != NULL) {__Pyx_GIVEREF(r);}} while(0)
1419 #else
1420  #define __Pyx_RefNannyDeclarations
1421  #define __Pyx_RefNannySetupContext(name, acquire_gil)
1422  #define __Pyx_RefNannyFinishContext()
1423  #define __Pyx_INCREF(r) Py_INCREF(r)
1424  #define __Pyx_DECREF(r) Py_DECREF(r)
1425  #define __Pyx_GOTREF(r)
1426  #define __Pyx_GIVEREF(r)
1427  #define __Pyx_XINCREF(r) Py_XINCREF(r)
1428  #define __Pyx_XDECREF(r) Py_XDECREF(r)
1429  #define __Pyx_XGOTREF(r)
1430  #define __Pyx_XGIVEREF(r)
1431 #endif
1432 #define __Pyx_XDECREF_SET(r, v) do {\
1433  PyObject *tmp = (PyObject *) r;\
1434  r = v; __Pyx_XDECREF(tmp);\
1435  } while (0)
1436 #define __Pyx_DECREF_SET(r, v) do {\
1437  PyObject *tmp = (PyObject *) r;\
1438  r = v; __Pyx_DECREF(tmp);\
1439  } while (0)
1440 #define __Pyx_CLEAR(r) do { PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);} while(0)
1441 #define __Pyx_XCLEAR(r) do { if((r) != NULL) {PyObject* tmp = ((PyObject*)(r)); r = NULL; __Pyx_DECREF(tmp);}} while(0)
1442 
1443 /* PyObjectGetAttrStr.proto */
1444 #if CYTHON_USE_TYPE_SLOTS
1445 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name);
1446 #else
1447 #define __Pyx_PyObject_GetAttrStr(o,n) PyObject_GetAttr(o,n)
1448 #endif
1449 
1450 /* GetBuiltinName.proto */
1451 static PyObject *__Pyx_GetBuiltinName(PyObject *name);
1452 
1453 /* RaiseDoubleKeywords.proto */
1454 static void __Pyx_RaiseDoubleKeywordsError(const char* func_name, PyObject* kw_name);
1455 
1456 /* ParseKeywords.proto */
1457 static int __Pyx_ParseOptionalKeywords(PyObject *kwds, PyObject **argnames[],\
1458  PyObject *kwds2, PyObject *values[], Py_ssize_t num_pos_args,\
1459  const char* function_name);
1460 
1461 /* RaiseArgTupleInvalid.proto */
1462 static void __Pyx_RaiseArgtupleInvalid(const char* func_name, int exact,
1463  Py_ssize_t num_min, Py_ssize_t num_max, Py_ssize_t num_found);
1464 
1465 /* GetItemInt.proto */
1466 #define __Pyx_GetItemInt(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1467  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1468  __Pyx_GetItemInt_Fast(o, (Py_ssize_t)i, is_list, wraparound, boundscheck) :\
1469  (is_list ? (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL) :\
1470  __Pyx_GetItemInt_Generic(o, to_py_func(i))))
1471 #define __Pyx_GetItemInt_List(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1472  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1473  __Pyx_GetItemInt_List_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1474  (PyErr_SetString(PyExc_IndexError, "list index out of range"), (PyObject*)NULL))
1475 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
1476  int wraparound, int boundscheck);
1477 #define __Pyx_GetItemInt_Tuple(o, i, type, is_signed, to_py_func, is_list, wraparound, boundscheck)\
1478  (__Pyx_fits_Py_ssize_t(i, type, is_signed) ?\
1479  __Pyx_GetItemInt_Tuple_Fast(o, (Py_ssize_t)i, wraparound, boundscheck) :\
1480  (PyErr_SetString(PyExc_IndexError, "tuple index out of range"), (PyObject*)NULL))
1481 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
1482  int wraparound, int boundscheck);
1483 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j);
1484 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i,
1485  int is_list, int wraparound, int boundscheck);
1486 
1487 /* ObjectGetItem.proto */
1488 #if CYTHON_USE_TYPE_SLOTS
1489 static CYTHON_INLINE PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key);
1490 #else
1491 #define __Pyx_PyObject_GetItem(obj, key) PyObject_GetItem(obj, key)
1492 #endif
1493 
1494 /* MemviewSliceInit.proto */
1495 #define __Pyx_BUF_MAX_NDIMS %(BUF_MAX_NDIMS)d
1496 #define __Pyx_MEMVIEW_DIRECT 1
1497 #define __Pyx_MEMVIEW_PTR 2
1498 #define __Pyx_MEMVIEW_FULL 4
1499 #define __Pyx_MEMVIEW_CONTIG 8
1500 #define __Pyx_MEMVIEW_STRIDED 16
1501 #define __Pyx_MEMVIEW_FOLLOW 32
1502 #define __Pyx_IS_C_CONTIG 1
1503 #define __Pyx_IS_F_CONTIG 2
1504 static int __Pyx_init_memviewslice(
1505  struct __pyx_memoryview_obj *memview,
1506  int ndim,
1507  __Pyx_memviewslice *memviewslice,
1508  int memview_is_new_reference);
1509 static CYTHON_INLINE int __pyx_add_acquisition_count_locked(
1510  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1511 static CYTHON_INLINE int __pyx_sub_acquisition_count_locked(
1512  __pyx_atomic_int *acquisition_count, PyThread_type_lock lock);
1513 #define __pyx_get_slice_count_pointer(memview) (memview->acquisition_count_aligned_p)
1514 #define __pyx_get_slice_count(memview) (*__pyx_get_slice_count_pointer(memview))
1515 #define __PYX_INC_MEMVIEW(slice, have_gil) __Pyx_INC_MEMVIEW(slice, have_gil, __LINE__)
1516 #define __PYX_XDEC_MEMVIEW(slice, have_gil) __Pyx_XDEC_MEMVIEW(slice, have_gil, __LINE__)
1517 static CYTHON_INLINE void __Pyx_INC_MEMVIEW(__Pyx_memviewslice *, int, int);
1518 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *, int, int);
1519 
1520 /* Import.proto */
1521 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level);
1522 
1523 /* ImportFrom.proto */
1524 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name);
1525 
1526 /* PyCFunctionFastCall.proto */
1527 #if CYTHON_FAST_PYCCALL
1528 static CYTHON_INLINE PyObject *__Pyx_PyCFunction_FastCall(PyObject *func, PyObject **args, Py_ssize_t nargs);
1529 #else
1530 #define __Pyx_PyCFunction_FastCall(func, args, nargs) (assert(0), NULL)
1531 #endif
1532 
1533 /* PyFunctionFastCall.proto */
1534 #if CYTHON_FAST_PYCALL
1535 #define __Pyx_PyFunction_FastCall(func, args, nargs)\
1536  __Pyx_PyFunction_FastCallDict((func), (args), (nargs), NULL)
1537 #if 1 || PY_VERSION_HEX < 0x030600B1
1538 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs);
1539 #else
1540 #define __Pyx_PyFunction_FastCallDict(func, args, nargs, kwargs) _PyFunction_FastCallDict(func, args, nargs, kwargs)
1541 #endif
1542 #endif
1543 
1544 /* PyObjectCall.proto */
1545 #if CYTHON_COMPILING_IN_CPYTHON
1546 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw);
1547 #else
1548 #define __Pyx_PyObject_Call(func, arg, kw) PyObject_Call(func, arg, kw)
1549 #endif
1550 
1551 /* PyObjectCallMethO.proto */
1552 #if CYTHON_COMPILING_IN_CPYTHON
1553 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg);
1554 #endif
1555 
1556 /* PyObjectCallOneArg.proto */
1557 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg);
1558 
1559 /* PyObjectCallNoArg.proto */
1560 #if CYTHON_COMPILING_IN_CPYTHON
1561 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func);
1562 #else
1563 #define __Pyx_PyObject_CallNoArg(func) __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL)
1564 #endif
1565 
1566 /* PyErrExceptionMatches.proto */
1567 #if CYTHON_FAST_THREAD_STATE
1568 #define __Pyx_PyErr_ExceptionMatches(err) __Pyx_PyErr_ExceptionMatchesInState(__pyx_tstate, err)
1569 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err);
1570 #else
1571 #define __Pyx_PyErr_ExceptionMatches(err) PyErr_ExceptionMatches(err)
1572 #endif
1573 
1574 /* PyThreadStateGet.proto */
1575 #if CYTHON_FAST_THREAD_STATE
1576 #define __Pyx_PyThreadState_declare PyThreadState *__pyx_tstate;
1577 #define __Pyx_PyThreadState_assign __pyx_tstate = __Pyx_PyThreadState_Current;
1578 #define __Pyx_PyErr_Occurred() __pyx_tstate->curexc_type
1579 #else
1580 #define __Pyx_PyThreadState_declare
1581 #define __Pyx_PyThreadState_assign
1582 #define __Pyx_PyErr_Occurred() PyErr_Occurred()
1583 #endif
1584 
1585 /* PyErrFetchRestore.proto */
1586 #if CYTHON_FAST_THREAD_STATE
1587 #define __Pyx_PyErr_Clear() __Pyx_ErrRestore(NULL, NULL, NULL)
1588 #define __Pyx_ErrRestoreWithState(type, value, tb) __Pyx_ErrRestoreInState(PyThreadState_GET(), type, value, tb)
1589 #define __Pyx_ErrFetchWithState(type, value, tb) __Pyx_ErrFetchInState(PyThreadState_GET(), type, value, tb)
1590 #define __Pyx_ErrRestore(type, value, tb) __Pyx_ErrRestoreInState(__pyx_tstate, type, value, tb)
1591 #define __Pyx_ErrFetch(type, value, tb) __Pyx_ErrFetchInState(__pyx_tstate, type, value, tb)
1592 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1593 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1594 #if CYTHON_COMPILING_IN_CPYTHON
1595 #define __Pyx_PyErr_SetNone(exc) (Py_INCREF(exc), __Pyx_ErrRestore((exc), NULL, NULL))
1596 #else
1597 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1598 #endif
1599 #else
1600 #define __Pyx_PyErr_Clear() PyErr_Clear()
1601 #define __Pyx_PyErr_SetNone(exc) PyErr_SetNone(exc)
1602 #define __Pyx_ErrRestoreWithState(type, value, tb) PyErr_Restore(type, value, tb)
1603 #define __Pyx_ErrFetchWithState(type, value, tb) PyErr_Fetch(type, value, tb)
1604 #define __Pyx_ErrRestoreInState(tstate, type, value, tb) PyErr_Restore(type, value, tb)
1605 #define __Pyx_ErrFetchInState(tstate, type, value, tb) PyErr_Fetch(type, value, tb)
1606 #define __Pyx_ErrRestore(type, value, tb) PyErr_Restore(type, value, tb)
1607 #define __Pyx_ErrFetch(type, value, tb) PyErr_Fetch(type, value, tb)
1608 #endif
1609 
1610 /* GetAttr.proto */
1611 static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *, PyObject *);
1612 
1613 /* GetAttr3.proto */
1614 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *, PyObject *, PyObject *);
1615 
1616 /* GetModuleGlobalName.proto */
1617 static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name);
1618 
1619 /* KeywordStringCheck.proto */
1620 static int __Pyx_CheckKeywordStrings(PyObject *kwdict, const char* function_name, int kw_allowed);
1621 
1622 /* WriteUnraisableException.proto */
1623 static void __Pyx_WriteUnraisable(const char *name, int clineno,
1624  int lineno, const char *filename,
1625  int full_traceback, int nogil);
1626 
1627 /* None.proto */
1628 static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname);
1629 
1630 /* FetchCommonType.proto */
1631 static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type);
1632 
1633 /* CythonFunction.proto */
1634 #define __Pyx_CyFunction_USED 1
1635 #define __Pyx_CYFUNCTION_STATICMETHOD 0x01
1636 #define __Pyx_CYFUNCTION_CLASSMETHOD 0x02
1637 #define __Pyx_CYFUNCTION_CCLASS 0x04
1638 #define __Pyx_CyFunction_GetClosure(f)\
1639  (((__pyx_CyFunctionObject *) (f))->func_closure)
1640 #define __Pyx_CyFunction_GetClassObj(f)\
1641  (((__pyx_CyFunctionObject *) (f))->func_classobj)
1642 #define __Pyx_CyFunction_Defaults(type, f)\
1643  ((type *)(((__pyx_CyFunctionObject *) (f))->defaults))
1644 #define __Pyx_CyFunction_SetDefaultsGetter(f, g)\
1645  ((__pyx_CyFunctionObject *) (f))->defaults_getter = (g)
1646 typedef struct {
1647  PyCFunctionObject func;
1648 #if PY_VERSION_HEX < 0x030500A0
1649  PyObject *func_weakreflist;
1650 #endif
1651  PyObject *func_dict;
1652  PyObject *func_name;
1653  PyObject *func_qualname;
1654  PyObject *func_doc;
1655  PyObject *func_globals;
1656  PyObject *func_code;
1657  PyObject *func_closure;
1658  PyObject *func_classobj;
1659  void *defaults;
1660  int defaults_pyobjects;
1661  int flags;
1662  PyObject *defaults_tuple;
1663  PyObject *defaults_kwdict;
1664  PyObject *(*defaults_getter)(PyObject *);
1665  PyObject *func_annotations;
1666 } __pyx_CyFunctionObject;
1667 static PyTypeObject *__pyx_CyFunctionType = 0;
1668 #define __Pyx_CyFunction_NewEx(ml, flags, qualname, self, module, globals, code)\
1669  __Pyx_CyFunction_New(__pyx_CyFunctionType, ml, flags, qualname, self, module, globals, code)
1670 static PyObject *__Pyx_CyFunction_New(PyTypeObject *, PyMethodDef *ml,
1671  int flags, PyObject* qualname,
1672  PyObject *self,
1673  PyObject *module, PyObject *globals,
1674  PyObject* code);
1675 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *m,
1676  size_t size,
1677  int pyobjects);
1678 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *m,
1679  PyObject *tuple);
1680 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *m,
1681  PyObject *dict);
1682 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *m,
1683  PyObject *dict);
1684 static int __pyx_CyFunction_init(void);
1685 
1686 /* RaiseException.proto */
1687 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause);
1688 
1689 /* HasAttr.proto */
1690 static CYTHON_INLINE int __Pyx_HasAttr(PyObject *, PyObject *);
1691 
1692 /* DictGetItem.proto */
1693 #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
1694 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key);
1695 #define __Pyx_PyObject_Dict_GetItem(obj, name)\
1696  (likely(PyDict_CheckExact(obj)) ?\
1697  __Pyx_PyDict_GetItem(obj, name) : PyObject_GetItem(obj, name))
1698 #else
1699 #define __Pyx_PyDict_GetItem(d, key) PyObject_GetItem(d, key)
1700 #define __Pyx_PyObject_Dict_GetItem(obj, name) PyObject_GetItem(obj, name)
1701 #endif
1702 
1703 /* RaiseTooManyValuesToUnpack.proto */
1704 static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected);
1705 
1706 /* RaiseNeedMoreValuesToUnpack.proto */
1707 static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index);
1708 
1709 /* RaiseNoneIterError.proto */
1710 static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void);
1711 
1712 /* ExtTypeTest.proto */
1713 static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type);
1714 
1715 /* SaveResetException.proto */
1716 #if CYTHON_FAST_THREAD_STATE
1717 #define __Pyx_ExceptionSave(type, value, tb) __Pyx__ExceptionSave(__pyx_tstate, type, value, tb)
1718 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1719 #define __Pyx_ExceptionReset(type, value, tb) __Pyx__ExceptionReset(__pyx_tstate, type, value, tb)
1720 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb);
1721 #else
1722 #define __Pyx_ExceptionSave(type, value, tb) PyErr_GetExcInfo(type, value, tb)
1723 #define __Pyx_ExceptionReset(type, value, tb) PyErr_SetExcInfo(type, value, tb)
1724 #endif
1725 
1726 /* GetException.proto */
1727 #if CYTHON_FAST_THREAD_STATE
1728 #define __Pyx_GetException(type, value, tb) __Pyx__GetException(__pyx_tstate, type, value, tb)
1729 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1730 #else
1731 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb);
1732 #endif
1733 
1734 /* ArgTypeTest.proto */
1735 #define __Pyx_ArgTypeTest(obj, type, none_allowed, name, exact)\
1736  ((likely((Py_TYPE(obj) == type) | (none_allowed && (obj == Py_None)))) ? 1 :\
1737  __Pyx__ArgTypeTest(obj, type, name, exact))
1738 static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact);
1739 
1740 /* IncludeStringH.proto */
1741 #include <string.h>
1742 
1743 /* BytesEquals.proto */
1744 static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals);
1745 
1746 /* UnicodeEquals.proto */
1747 static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals);
1748 
1749 /* StrEquals.proto */
1750 #if PY_MAJOR_VERSION >= 3
1751 #define __Pyx_PyString_Equals __Pyx_PyUnicode_Equals
1752 #else
1753 #define __Pyx_PyString_Equals __Pyx_PyBytes_Equals
1754 #endif
1755 
1756 /* None.proto */
1757 static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t, Py_ssize_t);
1758 
1759 /* UnaryNegOverflows.proto */
1760 #define UNARY_NEG_WOULD_OVERFLOW(x)\
1761  (((x) < 0) & ((unsigned long)(x) == 0-(unsigned long)(x)))
1762 
1763 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1764 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *); /*proto*/
1765 /* decode_c_string_utf16.proto */
1766 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16(const char *s, Py_ssize_t size, const char *errors) {
1767  int byteorder = 0;
1768  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1769 }
1770 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16LE(const char *s, Py_ssize_t size, const char *errors) {
1771  int byteorder = -1;
1772  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1773 }
1774 static CYTHON_INLINE PyObject *__Pyx_PyUnicode_DecodeUTF16BE(const char *s, Py_ssize_t size, const char *errors) {
1775  int byteorder = 1;
1776  return PyUnicode_DecodeUTF16(s, size, errors, &byteorder);
1777 }
1778 
1779 /* decode_c_string.proto */
1780 static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
1781  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
1782  const char* encoding, const char* errors,
1783  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors));
1784 
1785 /* SwapException.proto */
1786 #if CYTHON_FAST_THREAD_STATE
1787 #define __Pyx_ExceptionSwap(type, value, tb) __Pyx__ExceptionSwap(__pyx_tstate, type, value, tb)
1788 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb);
1789 #else
1790 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb);
1791 #endif
1792 
1793 /* FastTypeChecks.proto */
1794 #if CYTHON_COMPILING_IN_CPYTHON
1795 #define __Pyx_TypeCheck(obj, type) __Pyx_IsSubtype(Py_TYPE(obj), (PyTypeObject *)type)
1796 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b);
1797 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject *type);
1798 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *type1, PyObject *type2);
1799 #else
1800 #define __Pyx_TypeCheck(obj, type) PyObject_TypeCheck(obj, (PyTypeObject *)type)
1801 #define __Pyx_PyErr_GivenExceptionMatches(err, type) PyErr_GivenExceptionMatches(err, type)
1802 #define __Pyx_PyErr_GivenExceptionMatches2(err, type1, type2) (PyErr_GivenExceptionMatches(err, type1) || PyErr_GivenExceptionMatches(err, type2))
1803 #endif
1804 #define __Pyx_PyException_Check(obj) __Pyx_TypeCheck(obj, PyExc_Exception)
1805 
1806 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
1807 /* ListCompAppend.proto */
1808 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1809 static CYTHON_INLINE int __Pyx_ListComp_Append(PyObject* list, PyObject* x) {
1810  PyListObject* L = (PyListObject*) list;
1811  Py_ssize_t len = Py_SIZE(list);
1812  if (likely(L->allocated > len)) {
1813  Py_INCREF(x);
1814  PyList_SET_ITEM(list, len, x);
1815  Py_SIZE(list) = len+1;
1816  return 0;
1817  }
1818  return PyList_Append(list, x);
1819 }
1820 #else
1821 #define __Pyx_ListComp_Append(L,x) PyList_Append(L,x)
1822 #endif
1823 
1824 /* PyIntBinop.proto */
1825 #if !CYTHON_COMPILING_IN_PYPY
1826 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, long intval, int inplace);
1827 #else
1828 #define __Pyx_PyInt_AddObjC(op1, op2, intval, inplace)\
1829  (inplace ? PyNumber_InPlaceAdd(op1, op2) : PyNumber_Add(op1, op2))
1830 #endif
1831 
1832 /* ListExtend.proto */
1833 static CYTHON_INLINE int __Pyx_PyList_Extend(PyObject* L, PyObject* v) {
1834 #if CYTHON_COMPILING_IN_CPYTHON
1835  PyObject* none = _PyList_Extend((PyListObject*)L, v);
1836  if (unlikely(!none))
1837  return -1;
1838  Py_DECREF(none);
1839  return 0;
1840 #else
1841  return PyList_SetSlice(L, PY_SSIZE_T_MAX, PY_SSIZE_T_MAX, v);
1842 #endif
1843 }
1844 
1845 /* ListAppend.proto */
1846 #if CYTHON_USE_PYLIST_INTERNALS && CYTHON_ASSUME_SAFE_MACROS
1847 static CYTHON_INLINE int __Pyx_PyList_Append(PyObject* list, PyObject* x) {
1848  PyListObject* L = (PyListObject*) list;
1849  Py_ssize_t len = Py_SIZE(list);
1850  if (likely(L->allocated > len) & likely(len > (L->allocated >> 1))) {
1851  Py_INCREF(x);
1852  PyList_SET_ITEM(list, len, x);
1853  Py_SIZE(list) = len+1;
1854  return 0;
1855  }
1856  return PyList_Append(list, x);
1857 }
1858 #else
1859 #define __Pyx_PyList_Append(L,x) PyList_Append(L,x)
1860 #endif
1861 
1862 /* None.proto */
1863 static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname);
1864 
1865 /* None.proto */
1866 static CYTHON_INLINE long __Pyx_div_long(long, long);
1867 
1868 /* PyObject_GenericGetAttrNoDict.proto */
1869 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1870 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name);
1871 #else
1872 #define __Pyx_PyObject_GenericGetAttrNoDict PyObject_GenericGetAttr
1873 #endif
1874 
1875 /* PyObject_GenericGetAttr.proto */
1876 #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
1877 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name);
1878 #else
1879 #define __Pyx_PyObject_GenericGetAttr PyObject_GenericGetAttr
1880 #endif
1881 
1882 /* SetupReduce.proto */
1883 static int __Pyx_setup_reduce(PyObject* type_obj);
1884 
1885 /* SetVTable.proto */
1886 static int __Pyx_SetVtable(PyObject *dict, void *vtable);
1887 
1888 /* CLineInTraceback.proto */
1889 #ifdef CYTHON_CLINE_IN_TRACEBACK
1890 #define __Pyx_CLineForTraceback(tstate, c_line) (((CYTHON_CLINE_IN_TRACEBACK)) ? c_line : 0)
1891 #else
1892 static int __Pyx_CLineForTraceback(PyThreadState *tstate, int c_line);
1893 #endif
1894 
1895 /* CodeObjectCache.proto */
1896 typedef struct {
1897  PyCodeObject* code_object;
1898  int code_line;
1899 } __Pyx_CodeObjectCacheEntry;
1900 struct __Pyx_CodeObjectCache {
1901  int count;
1902  int max_count;
1903  __Pyx_CodeObjectCacheEntry* entries;
1904 };
1905 static struct __Pyx_CodeObjectCache __pyx_code_cache = {0,0,NULL};
1906 static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line);
1907 static PyCodeObject *__pyx_find_code_object(int code_line);
1908 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object);
1909 
1910 /* AddTraceback.proto */
1911 static void __Pyx_AddTraceback(const char *funcname, int c_line,
1912  int py_line, const char *filename);
1913 
1914 #if PY_MAJOR_VERSION < 3
1915  static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags);
1916  static void __Pyx_ReleaseBuffer(Py_buffer *view);
1917 #else
1918  #define __Pyx_GetBuffer PyObject_GetBuffer
1919  #define __Pyx_ReleaseBuffer PyBuffer_Release
1920 #endif
1921 
1922 
1923 /* BufferStructDeclare.proto */
1924 typedef struct {
1925  Py_ssize_t shape, strides, suboffsets;
1926 } __Pyx_Buf_DimInfo;
1927 typedef struct {
1928  size_t refcount;
1929  Py_buffer pybuffer;
1930 } __Pyx_Buffer;
1931 typedef struct {
1932  __Pyx_Buffer *rcbuffer;
1933  char *data;
1934  __Pyx_Buf_DimInfo diminfo[8];
1935 } __Pyx_LocalBuf_ND;
1936 
1937 /* MemviewSliceIsContig.proto */
1938 static int __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim);
1939 
1940 /* OverlappingSlices.proto */
1941 static int __pyx_slices_overlap(__Pyx_memviewslice *slice1,
1942  __Pyx_memviewslice *slice2,
1943  int ndim, size_t itemsize);
1944 
1945 /* Capsule.proto */
1946 static CYTHON_INLINE PyObject *__pyx_capsule_create(void *p, const char *sig);
1947 
1948 /* MemviewDtypeToObject.proto */
1949 static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp);
1950 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj);
1951 
1952 /* IsLittleEndian.proto */
1953 static CYTHON_INLINE int __Pyx_Is_Little_Endian(void);
1954 
1955 /* BufferFormatCheck.proto */
1956 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts);
1957 static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
1958  __Pyx_BufFmt_StackElem* stack,
1959  __Pyx_TypeInfo* type);
1960 
1961 /* TypeInfoCompare.proto */
1962 static int __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b);
1963 
1964 /* MemviewSliceValidateAndInit.proto */
1965 static int __Pyx_ValidateAndInit_memviewslice(
1966  int *axes_specs,
1967  int c_or_f_flag,
1968  int buf_flags,
1969  int ndim,
1970  __Pyx_TypeInfo *dtype,
1971  __Pyx_BufFmt_StackElem stack[],
1972  __Pyx_memviewslice *memviewslice,
1973  PyObject *original_obj);
1974 
1975 /* ObjectToMemviewSlice.proto */
1976 static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *, int writable_flag);
1977 
1978 /* CIntToPy.proto */
1979 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value);
1980 
1981 /* CIntToPy.proto */
1982 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value);
1983 
1984 /* RealImag.proto */
1985 #if CYTHON_CCOMPLEX
1986  #ifdef __cplusplus
1987  #define __Pyx_CREAL(z) ((z).real())
1988  #define __Pyx_CIMAG(z) ((z).imag())
1989  #else
1990  #define __Pyx_CREAL(z) (__real__(z))
1991  #define __Pyx_CIMAG(z) (__imag__(z))
1992  #endif
1993 #else
1994  #define __Pyx_CREAL(z) ((z).real)
1995  #define __Pyx_CIMAG(z) ((z).imag)
1996 #endif
1997 #if defined(__cplusplus) && CYTHON_CCOMPLEX\
1998  && (defined(_WIN32) || defined(__clang__) || (defined(__GNUC__) && (__GNUC__ >= 5 || __GNUC__ == 4 && __GNUC_MINOR__ >= 4 )) || __cplusplus >= 201103)
1999  #define __Pyx_SET_CREAL(z,x) ((z).real(x))
2000  #define __Pyx_SET_CIMAG(z,y) ((z).imag(y))
2001 #else
2002  #define __Pyx_SET_CREAL(z,x) __Pyx_CREAL(z) = (x)
2003  #define __Pyx_SET_CIMAG(z,y) __Pyx_CIMAG(z) = (y)
2004 #endif
2005 
2006 /* Arithmetic.proto */
2007 #if CYTHON_CCOMPLEX
2008  #define __Pyx_c_eq_float(a, b) ((a)==(b))
2009  #define __Pyx_c_sum_float(a, b) ((a)+(b))
2010  #define __Pyx_c_diff_float(a, b) ((a)-(b))
2011  #define __Pyx_c_prod_float(a, b) ((a)*(b))
2012  #define __Pyx_c_quot_float(a, b) ((a)/(b))
2013  #define __Pyx_c_neg_float(a) (-(a))
2014  #ifdef __cplusplus
2015  #define __Pyx_c_is_zero_float(z) ((z)==(float)0)
2016  #define __Pyx_c_conj_float(z) (::std::conj(z))
2017  #if 1
2018  #define __Pyx_c_abs_float(z) (::std::abs(z))
2019  #define __Pyx_c_pow_float(a, b) (::std::pow(a, b))
2020  #endif
2021  #else
2022  #define __Pyx_c_is_zero_float(z) ((z)==0)
2023  #define __Pyx_c_conj_float(z) (conjf(z))
2024  #if 1
2025  #define __Pyx_c_abs_float(z) (cabsf(z))
2026  #define __Pyx_c_pow_float(a, b) (cpowf(a, b))
2027  #endif
2028  #endif
2029 #else
2030  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex, __pyx_t_float_complex);
2031  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex, __pyx_t_float_complex);
2032  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex, __pyx_t_float_complex);
2033  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex, __pyx_t_float_complex);
2034  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex, __pyx_t_float_complex);
2035  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex);
2036  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex);
2037  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex);
2038  #if 1
2039  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex);
2040  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex, __pyx_t_float_complex);
2041  #endif
2042 #endif
2043 
2044 /* Arithmetic.proto */
2045 #if CYTHON_CCOMPLEX
2046  #define __Pyx_c_eq_double(a, b) ((a)==(b))
2047  #define __Pyx_c_sum_double(a, b) ((a)+(b))
2048  #define __Pyx_c_diff_double(a, b) ((a)-(b))
2049  #define __Pyx_c_prod_double(a, b) ((a)*(b))
2050  #define __Pyx_c_quot_double(a, b) ((a)/(b))
2051  #define __Pyx_c_neg_double(a) (-(a))
2052  #ifdef __cplusplus
2053  #define __Pyx_c_is_zero_double(z) ((z)==(double)0)
2054  #define __Pyx_c_conj_double(z) (::std::conj(z))
2055  #if 1
2056  #define __Pyx_c_abs_double(z) (::std::abs(z))
2057  #define __Pyx_c_pow_double(a, b) (::std::pow(a, b))
2058  #endif
2059  #else
2060  #define __Pyx_c_is_zero_double(z) ((z)==0)
2061  #define __Pyx_c_conj_double(z) (conj(z))
2062  #if 1
2063  #define __Pyx_c_abs_double(z) (cabs(z))
2064  #define __Pyx_c_pow_double(a, b) (cpow(a, b))
2065  #endif
2066  #endif
2067 #else
2068  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex, __pyx_t_double_complex);
2069  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex, __pyx_t_double_complex);
2070  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex, __pyx_t_double_complex);
2071  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex, __pyx_t_double_complex);
2072  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex, __pyx_t_double_complex);
2073  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex);
2074  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex);
2075  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex);
2076  #if 1
2077  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex);
2078  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex, __pyx_t_double_complex);
2079  #endif
2080 #endif
2081 
2082 /* CIntToPy.proto */
2083 static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value);
2084 
2085 /* MemviewSliceCopyTemplate.proto */
2086 static __Pyx_memviewslice
2087 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
2088  const char *mode, int ndim,
2089  size_t sizeof_dtype, int contig_flag,
2090  int dtype_is_object);
2091 
2092 /* CIntFromPy.proto */
2093 static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *);
2094 
2095 /* CIntFromPy.proto */
2096 static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *);
2097 
2098 /* CIntFromPy.proto */
2099 static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *);
2100 
2101 /* CheckBinaryVersion.proto */
2102 static int __Pyx_check_binary_version(void);
2103 
2104 /* PyIdentifierFromString.proto */
2105 #if !defined(__Pyx_PyIdentifier_FromString)
2106 #if PY_MAJOR_VERSION < 3
2107  #define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
2108 #else
2109  #define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
2110 #endif
2111 #endif
2112 
2113 /* ModuleImport.proto */
2114 static PyObject *__Pyx_ImportModule(const char *name);
2115 
2116 /* TypeImport.proto */
2117 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name, size_t size, int strict);
2118 
2119 /* InitStrings.proto */
2120 static int __Pyx_InitStrings(__Pyx_StringTabEntry *t);
2121 
2122 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch); /* proto*/
2123 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self); /* proto*/
2124 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto*/
2125 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj); /* proto*/
2126 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src); /* proto*/
2127 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value); /* proto*/
2128 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto*/
2129 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2130 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2131 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp); /* proto*/
2132 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value); /* proto*/
2133 
2134 /* Module declarations from 'cython.view' */
2135 
2136 /* Module declarations from 'cython' */
2137 
2138 /* Module declarations from 'cpython.buffer' */
2139 
2140 /* Module declarations from 'libc.string' */
2141 
2142 /* Module declarations from 'libc.stdio' */
2143 
2144 /* Module declarations from '__builtin__' */
2145 
2146 /* Module declarations from 'cpython.type' */
2147 static PyTypeObject *__pyx_ptype_7cpython_4type_type = 0;
2148 
2149 /* Module declarations from 'cpython' */
2150 
2151 /* Module declarations from 'cpython.object' */
2152 
2153 /* Module declarations from 'cpython.ref' */
2154 
2155 /* Module declarations from 'cpython.mem' */
2156 
2157 /* Module declarations from 'numpy' */
2158 
2159 /* Module declarations from 'numpy' */
2160 static PyTypeObject *__pyx_ptype_5numpy_dtype = 0;
2161 static PyTypeObject *__pyx_ptype_5numpy_flatiter = 0;
2162 static PyTypeObject *__pyx_ptype_5numpy_broadcast = 0;
2163 static PyTypeObject *__pyx_ptype_5numpy_ndarray = 0;
2164 static PyTypeObject *__pyx_ptype_5numpy_ufunc = 0;
2165 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *, char *, char *, int *); /*proto*/
2166 
2167 /* Module declarations from 'BoundaryConditions' */
2168 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BC_Base = 0;
2169 static PyTypeObject *__pyx_ptype_18BoundaryConditions_BoundaryCondition = 0;
2170 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
2171 static PyTypeObject *__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
2172 static PyTypeObject *__pyx_array_type = 0;
2173 static PyTypeObject *__pyx_MemviewEnum_type = 0;
2174 static PyTypeObject *__pyx_memoryview_type = 0;
2175 static PyTypeObject *__pyx_memoryviewslice_type = 0;
2176 static PyObject *generic = 0;
2177 static PyObject *strided = 0;
2178 static PyObject *indirect = 0;
2179 static PyObject *contiguous = 0;
2180 static PyObject *indirect_contiguous = 0;
2181 static int __pyx_memoryview_thread_locks_used;
2182 static PyThread_type_lock __pyx_memoryview_thread_locks[8];
2183 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *, PyObject *); /*proto*/
2184 static struct __pyx_array_obj *__pyx_array_new(PyObject *, Py_ssize_t, char *, char *, char *); /*proto*/
2185 static void *__pyx_align_pointer(void *, size_t); /*proto*/
2186 static PyObject *__pyx_memoryview_new(PyObject *, int, int, __Pyx_TypeInfo *); /*proto*/
2187 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *); /*proto*/
2188 static PyObject *_unellipsify(PyObject *, int); /*proto*/
2189 static PyObject *assert_direct_dimensions(Py_ssize_t *, int); /*proto*/
2190 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *, PyObject *); /*proto*/
2191 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int *, Py_ssize_t, Py_ssize_t, Py_ssize_t, int, int, int, int); /*proto*/
2192 static char *__pyx_pybuffer_index(Py_buffer *, char *, Py_ssize_t, Py_ssize_t); /*proto*/
2193 static int __pyx_memslice_transpose(__Pyx_memviewslice *); /*proto*/
2194 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice, int, PyObject *(*)(char *), int (*)(char *, PyObject *), int); /*proto*/
2195 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2196 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2197 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *); /*proto*/
2198 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *, __Pyx_memviewslice *); /*proto*/
2199 static Py_ssize_t abs_py_ssize_t(Py_ssize_t); /*proto*/
2200 static char __pyx_get_best_slice_order(__Pyx_memviewslice *, int); /*proto*/
2201 static void _copy_strided_to_strided(char *, Py_ssize_t *, char *, Py_ssize_t *, Py_ssize_t *, Py_ssize_t *, int, size_t); /*proto*/
2202 static void copy_strided_to_strided(__Pyx_memviewslice *, __Pyx_memviewslice *, int, size_t); /*proto*/
2203 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *, int); /*proto*/
2204 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *, Py_ssize_t *, Py_ssize_t, int, char); /*proto*/
2205 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *, __Pyx_memviewslice *, char, int); /*proto*/
2206 static int __pyx_memoryview_err_extents(int, Py_ssize_t, Py_ssize_t); /*proto*/
2207 static int __pyx_memoryview_err_dim(PyObject *, char *, int); /*proto*/
2208 static int __pyx_memoryview_err(PyObject *, char *); /*proto*/
2209 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice, __Pyx_memviewslice, int, int, int); /*proto*/
2210 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *, int, int); /*proto*/
2211 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *, int, int, int); /*proto*/
2212 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2213 static void __pyx_memoryview_refcount_objects_in_slice(char *, Py_ssize_t *, Py_ssize_t *, int, int); /*proto*/
2214 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *, int, size_t, void *, int); /*proto*/
2215 static void __pyx_memoryview__slice_assign_scalar(char *, Py_ssize_t *, Py_ssize_t *, int, size_t, void *); /*proto*/
2216 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *, PyObject *); /*proto*/
2217 static __Pyx_TypeInfo __Pyx_TypeInfo_double = { "double", NULL, sizeof(double), { 0 }, 0, 'R', 0, 0 };
2218 #define __Pyx_MODULE_NAME "BoundaryConditions"
2219 extern int __pyx_module_is_main_BoundaryConditions;
2220 int __pyx_module_is_main_BoundaryConditions = 0;
2221 
2222 /* Implementation of 'BoundaryConditions' */
2223 static PyObject *__pyx_builtin_TypeError;
2224 static PyObject *__pyx_builtin_ValueError;
2225 static PyObject *__pyx_builtin_range;
2226 static PyObject *__pyx_builtin_RuntimeError;
2227 static PyObject *__pyx_builtin_ImportError;
2228 static PyObject *__pyx_builtin_MemoryError;
2229 static PyObject *__pyx_builtin_enumerate;
2230 static PyObject *__pyx_builtin_Ellipsis;
2231 static PyObject *__pyx_builtin_id;
2232 static PyObject *__pyx_builtin_IndexError;
2233 static const char __pyx_k_O[] = "O";
2234 static const char __pyx_k_c[] = "c";
2235 static const char __pyx_k_i[] = "i";
2236 static const char __pyx_k_t[] = "t";
2237 static const char __pyx_k_x[] = "x";
2238 static const char __pyx_k_a0[] = "a0";
2239 static const char __pyx_k_a1[] = "a1";
2240 static const char __pyx_k_id[] = "id";
2241 static const char __pyx_k_nd[] = "nd";
2242 static const char __pyx_k_b_i[] = "b_i";
2243 static const char __pyx_k_get[] = "get";
2244 static const char __pyx_k_new[] = "__new__";
2245 static const char __pyx_k_obj[] = "obj";
2246 static const char __pyx_k_None[] = "None";
2247 static const char __pyx_k_b_or[] = "b_or";
2248 static const char __pyx_k_base[] = "base";
2249 static const char __pyx_k_dict[] = "__dict__";
2250 static const char __pyx_k_main[] = "__main__";
2251 static const char __pyx_k_mode[] = "mode";
2252 static const char __pyx_k_name[] = "name";
2253 static const char __pyx_k_ndim[] = "ndim";
2254 static const char __pyx_k_pack[] = "pack";
2255 static const char __pyx_k_self[] = "self";
2256 static const char __pyx_k_size[] = "size";
2257 static const char __pyx_k_step[] = "step";
2258 static const char __pyx_k_stop[] = "stop";
2259 static const char __pyx_k_test[] = "__test__";
2260 static const char __pyx_k_ASCII[] = "ASCII";
2261 static const char __pyx_k_class[] = "__class__";
2262 static const char __pyx_k_error[] = "error";
2263 static const char __pyx_k_flags[] = "flags";
2264 static const char __pyx_k_range[] = "range";
2265 static const char __pyx_k_shape[] = "shape";
2266 static const char __pyx_k_start[] = "start";
2267 static const char __pyx_k_state[] = "state";
2268 static const char __pyx_k_value[] = "value";
2269 static const char __pyx_k_Domain[] = "Domain";
2270 static const char __pyx_k_dict_2[] = "_dict";
2271 static const char __pyx_k_encode[] = "encode";
2272 static const char __pyx_k_format[] = "format";
2273 static const char __pyx_k_import[] = "__import__";
2274 static const char __pyx_k_name_2[] = "__name__";
2275 static const char __pyx_k_pickle[] = "pickle";
2276 static const char __pyx_k_reduce[] = "__reduce__";
2277 static const char __pyx_k_struct[] = "struct";
2278 static const char __pyx_k_unpack[] = "unpack";
2279 static const char __pyx_k_update[] = "update";
2280 static const char __pyx_k_Context[] = "Context";
2281 static const char __pyx_k_context[] = "context";
2282 static const char __pyx_k_fortran[] = "fortran";
2283 static const char __pyx_k_memview[] = "memview";
2284 static const char __pyx_k_proteus[] = "proteus";
2285 static const char __pyx_k_resetBC[] = "resetBC";
2286 static const char __pyx_k_Ellipsis[] = "Ellipsis";
2287 static const char __pyx_k_getstate[] = "__getstate__";
2288 static const char __pyx_k_itemsize[] = "itemsize";
2289 static const char __pyx_k_pyx_type[] = "__pyx_type";
2290 static const char __pyx_k_setstate[] = "__setstate__";
2291 static const char __pyx_k_TypeError[] = "TypeError";
2292 static const char __pyx_k_enumerate[] = "enumerate";
2293 static const char __pyx_k_pyx_state[] = "__pyx_state";
2294 static const char __pyx_k_reduce_ex[] = "__reduce_ex__";
2295 static const char __pyx_k_IndexError[] = "IndexError";
2296 static const char __pyx_k_ValueError[] = "ValueError";
2297 static const char __pyx_k_getContext[] = "getContext";
2298 static const char __pyx_k_pyx_result[] = "__pyx_result";
2299 static const char __pyx_k_pyx_vtable[] = "__pyx_vtable__";
2300 static const char __pyx_k_ImportError[] = "ImportError";
2301 static const char __pyx_k_MemoryError[] = "MemoryError";
2302 static const char __pyx_k_PickleError[] = "PickleError";
2303 static const char __pyx_k_init_cython[] = "init_cython";
2304 static const char __pyx_k_setLinearBC[] = "setLinearBC";
2305 static const char __pyx_k_RuntimeError[] = "RuntimeError";
2306 static const char __pyx_k_pyx_checksum[] = "__pyx_checksum";
2307 static const char __pyx_k_stringsource[] = "stringsource";
2308 static const char __pyx_k_use_setstate[] = "use_setstate";
2309 static const char __pyx_k_pyx_getbuffer[] = "__pyx_getbuffer";
2310 static const char __pyx_k_reduce_cython[] = "__reduce_cython__";
2311 static const char __pyx_k_setConstantBC[] = "setConstantBC";
2312 static const char __pyx_k_View_MemoryView[] = "View.MemoryView";
2313 static const char __pyx_k_allocate_buffer[] = "allocate_buffer";
2314 static const char __pyx_k_dtype_is_object[] = "dtype_is_object";
2315 static const char __pyx_k_pyx_PickleError[] = "__pyx_PickleError";
2316 static const char __pyx_k_setstate_cython[] = "__setstate_cython__";
2317 static const char __pyx_k_pyx_unpickle_Enum[] = "__pyx_unpickle_Enum";
2318 static const char __pyx_k_BC_Base_getContext[] = "BC_Base.getContext";
2319 static const char __pyx_k_BoundaryConditions[] = "BoundaryConditions";
2320 static const char __pyx_k_cline_in_traceback[] = "cline_in_traceback";
2321 static const char __pyx_k_strided_and_direct[] = "<strided and direct>";
2322 static const char __pyx_k_pyx_unpickle_BC_Base[] = "__pyx_unpickle_BC_Base";
2323 static const char __pyx_k_strided_and_indirect[] = "<strided and indirect>";
2324 static const char __pyx_k_contiguous_and_direct[] = "<contiguous and direct>";
2325 static const char __pyx_k_MemoryView_of_r_object[] = "<MemoryView of %r object>";
2326 static const char __pyx_k_BC_Base___reduce_cython[] = "BC_Base.__reduce_cython__";
2327 static const char __pyx_k_MemoryView_of_r_at_0x_x[] = "<MemoryView of %r at 0x%x>";
2328 static const char __pyx_k_contiguous_and_indirect[] = "<contiguous and indirect>";
2329 static const char __pyx_k_Cannot_index_with_type_s[] = "Cannot index with type '%s'";
2330 static const char __pyx_k_BC_Base___setstate_cython[] = "BC_Base.__setstate_cython__";
2331 static const char __pyx_k_BoundaryCondition_resetBC[] = "BoundaryCondition.resetBC";
2332 static const char __pyx_k_Invalid_shape_in_axis_d_d[] = "Invalid shape in axis %d: %d.";
2333 static const char __pyx_k_setLinearBC_locals_lambda[] = "setLinearBC.<locals>.<lambda>";
2334 static const char __pyx_k_itemsize_0_for_cython_array[] = "itemsize <= 0 for cython.array";
2335 static const char __pyx_k_ndarray_is_not_C_contiguous[] = "ndarray is not C contiguous";
2336 static const char __pyx_k_setConstantBC_locals_lambda[] = "setConstantBC.<locals>.<lambda>";
2337 static const char __pyx_k_BoundaryCondition_init_cython[] = "BoundaryCondition.init_cython";
2338 static const char __pyx_k_BoundaryCondition_setLinearBC[] = "BoundaryCondition.setLinearBC";
2339 static const char __pyx_k_proteus_BoundaryConditions_py[] = "proteus/BoundaryConditions.py";
2340 static const char __pyx_k_unable_to_allocate_array_data[] = "unable to allocate array data.";
2341 static const char __pyx_k_strided_and_direct_or_indirect[] = "<strided and direct or indirect>";
2342 static const char __pyx_k_BoundaryCondition_setConstantBC[] = "BoundaryCondition.setConstantBC";
2343 static const char __pyx_k_numpy_core_multiarray_failed_to[] = "numpy.core.multiarray failed to import";
2344 static const char __pyx_k_self_uuOfXT_cannot_be_converted[] = "self.uuOfXT cannot be converted to a Python object for pickling";
2345 static const char __pyx_k_unknown_dtype_code_in_numpy_pxd[] = "unknown dtype code in numpy.pxd (%d)";
2346 static const char __pyx_k_BoundaryCondition___reduce_cytho[] = "BoundaryCondition.__reduce_cython__";
2347 static const char __pyx_k_BoundaryCondition___setstate_cyt[] = "BoundaryCondition.__setstate_cython__";
2348 static const char __pyx_k_Buffer_view_does_not_expose_stri[] = "Buffer view does not expose strides";
2349 static const char __pyx_k_Can_only_create_a_buffer_that_is[] = "Can only create a buffer that is contiguous in memory.";
2350 static const char __pyx_k_Cannot_assign_to_read_only_memor[] = "Cannot assign to read-only memoryview";
2351 static const char __pyx_k_Cannot_create_writable_memory_vi[] = "Cannot create writable memory view from read-only memoryview";
2352 static const char __pyx_k_Empty_shape_tuple_for_cython_arr[] = "Empty shape tuple for cython.array";
2353 static const char __pyx_k_Format_string_allocated_too_shor[] = "Format string allocated too short, see comment in numpy.pxd";
2354 static const char __pyx_k_Incompatible_checksums_s_vs_0x96[] = "Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))";
2355 static const char __pyx_k_Incompatible_checksums_s_vs_0xb0[] = "Incompatible checksums (%s vs 0xb068931 = (name))";
2356 static const char __pyx_k_Indirect_dimensions_not_supporte[] = "Indirect dimensions not supported";
2357 static const char __pyx_k_Invalid_mode_expected_c_or_fortr[] = "Invalid mode, expected 'c' or 'fortran', got %s";
2358 static const char __pyx_k_Non_native_byte_order_not_suppor[] = "Non-native byte order not supported";
2359 static const char __pyx_k_Out_of_bounds_on_buffer_access_a[] = "Out of bounds on buffer access (axis %d)";
2360 static const char __pyx_k_Shape_or_nd_must_be_passed_to_BC[] = "Shape or nd must be passed to BC";
2361 static const char __pyx_k_Unable_to_convert_item_to_object[] = "Unable to convert item to object";
2362 static const char __pyx_k_got_differing_extents_in_dimensi[] = "got differing extents in dimension %d (got %d and %d)";
2363 static const char __pyx_k_ndarray_is_not_Fortran_contiguou[] = "ndarray is not Fortran contiguous";
2364 static const char __pyx_k_no_default___reduce___due_to_non[] = "no default __reduce__ due to non-trivial __cinit__";
2365 static const char __pyx_k_numpy_core_umath_failed_to_impor[] = "numpy.core.umath failed to import";
2366 static const char __pyx_k_unable_to_allocate_shape_and_str[] = "unable to allocate shape and strides.";
2367 static const char __pyx_k_Format_string_allocated_too_shor_2[] = "Format string allocated too short.";
2368 static PyObject *__pyx_n_s_ASCII;
2369 static PyObject *__pyx_n_s_BC_Base___reduce_cython;
2370 static PyObject *__pyx_n_s_BC_Base___setstate_cython;
2371 static PyObject *__pyx_n_s_BC_Base_getContext;
2372 static PyObject *__pyx_n_s_BoundaryCondition___reduce_cytho;
2373 static PyObject *__pyx_n_s_BoundaryCondition___setstate_cyt;
2374 static PyObject *__pyx_n_s_BoundaryCondition_init_cython;
2375 static PyObject *__pyx_n_s_BoundaryCondition_resetBC;
2376 static PyObject *__pyx_n_s_BoundaryCondition_setConstantBC;
2377 static PyObject *__pyx_n_s_BoundaryCondition_setLinearBC;
2378 static PyObject *__pyx_n_s_BoundaryConditions;
2379 static PyObject *__pyx_kp_s_Buffer_view_does_not_expose_stri;
2380 static PyObject *__pyx_kp_s_Can_only_create_a_buffer_that_is;
2381 static PyObject *__pyx_kp_s_Cannot_assign_to_read_only_memor;
2382 static PyObject *__pyx_kp_s_Cannot_create_writable_memory_vi;
2383 static PyObject *__pyx_kp_s_Cannot_index_with_type_s;
2384 static PyObject *__pyx_n_s_Context;
2385 static PyObject *__pyx_n_s_Domain;
2386 static PyObject *__pyx_n_s_Ellipsis;
2387 static PyObject *__pyx_kp_s_Empty_shape_tuple_for_cython_arr;
2388 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor;
2389 static PyObject *__pyx_kp_u_Format_string_allocated_too_shor_2;
2390 static PyObject *__pyx_n_s_ImportError;
2391 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0x96;
2392 static PyObject *__pyx_kp_s_Incompatible_checksums_s_vs_0xb0;
2393 static PyObject *__pyx_n_s_IndexError;
2394 static PyObject *__pyx_kp_s_Indirect_dimensions_not_supporte;
2395 static PyObject *__pyx_kp_s_Invalid_mode_expected_c_or_fortr;
2396 static PyObject *__pyx_kp_s_Invalid_shape_in_axis_d_d;
2397 static PyObject *__pyx_n_s_MemoryError;
2398 static PyObject *__pyx_kp_s_MemoryView_of_r_at_0x_x;
2399 static PyObject *__pyx_kp_s_MemoryView_of_r_object;
2400 static PyObject *__pyx_kp_u_Non_native_byte_order_not_suppor;
2401 static PyObject *__pyx_n_s_None;
2402 static PyObject *__pyx_n_b_O;
2403 static PyObject *__pyx_kp_s_Out_of_bounds_on_buffer_access_a;
2404 static PyObject *__pyx_n_s_PickleError;
2405 static PyObject *__pyx_n_s_RuntimeError;
2406 static PyObject *__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC;
2407 static PyObject *__pyx_n_s_TypeError;
2408 static PyObject *__pyx_kp_s_Unable_to_convert_item_to_object;
2409 static PyObject *__pyx_n_s_ValueError;
2410 static PyObject *__pyx_n_s_View_MemoryView;
2411 static PyObject *__pyx_n_s_a0;
2412 static PyObject *__pyx_n_s_a1;
2413 static PyObject *__pyx_n_s_allocate_buffer;
2414 static PyObject *__pyx_n_s_b_i;
2415 static PyObject *__pyx_n_s_b_or;
2416 static PyObject *__pyx_n_s_base;
2417 static PyObject *__pyx_n_s_c;
2418 static PyObject *__pyx_n_u_c;
2419 static PyObject *__pyx_n_s_class;
2420 static PyObject *__pyx_n_s_cline_in_traceback;
2421 static PyObject *__pyx_n_s_context;
2422 static PyObject *__pyx_kp_s_contiguous_and_direct;
2423 static PyObject *__pyx_kp_s_contiguous_and_indirect;
2424 static PyObject *__pyx_n_s_dict;
2425 static PyObject *__pyx_n_s_dict_2;
2426 static PyObject *__pyx_n_s_dtype_is_object;
2427 static PyObject *__pyx_n_s_encode;
2428 static PyObject *__pyx_n_s_enumerate;
2429 static PyObject *__pyx_n_s_error;
2430 static PyObject *__pyx_n_s_flags;
2431 static PyObject *__pyx_n_s_format;
2432 static PyObject *__pyx_n_s_fortran;
2433 static PyObject *__pyx_n_u_fortran;
2434 static PyObject *__pyx_n_s_get;
2435 static PyObject *__pyx_n_s_getContext;
2436 static PyObject *__pyx_n_s_getstate;
2437 static PyObject *__pyx_kp_s_got_differing_extents_in_dimensi;
2438 static PyObject *__pyx_n_s_i;
2439 static PyObject *__pyx_n_s_id;
2440 static PyObject *__pyx_n_s_import;
2441 static PyObject *__pyx_n_s_init_cython;
2442 static PyObject *__pyx_n_s_itemsize;
2443 static PyObject *__pyx_kp_s_itemsize_0_for_cython_array;
2444 static PyObject *__pyx_n_s_main;
2445 static PyObject *__pyx_n_s_memview;
2446 static PyObject *__pyx_n_s_mode;
2447 static PyObject *__pyx_n_s_name;
2448 static PyObject *__pyx_n_s_name_2;
2449 static PyObject *__pyx_n_s_nd;
2450 static PyObject *__pyx_kp_u_ndarray_is_not_C_contiguous;
2451 static PyObject *__pyx_kp_u_ndarray_is_not_Fortran_contiguou;
2452 static PyObject *__pyx_n_s_ndim;
2453 static PyObject *__pyx_n_s_new;
2454 static PyObject *__pyx_kp_s_no_default___reduce___due_to_non;
2455 static PyObject *__pyx_kp_s_numpy_core_multiarray_failed_to;
2456 static PyObject *__pyx_kp_s_numpy_core_umath_failed_to_impor;
2457 static PyObject *__pyx_n_s_obj;
2458 static PyObject *__pyx_n_s_pack;
2459 static PyObject *__pyx_n_s_pickle;
2460 static PyObject *__pyx_n_s_proteus;
2461 static PyObject *__pyx_kp_s_proteus_BoundaryConditions_py;
2462 static PyObject *__pyx_n_s_pyx_PickleError;
2463 static PyObject *__pyx_n_s_pyx_checksum;
2464 static PyObject *__pyx_n_s_pyx_getbuffer;
2465 static PyObject *__pyx_n_s_pyx_result;
2466 static PyObject *__pyx_n_s_pyx_state;
2467 static PyObject *__pyx_n_s_pyx_type;
2468 static PyObject *__pyx_n_s_pyx_unpickle_BC_Base;
2469 static PyObject *__pyx_n_s_pyx_unpickle_Enum;
2470 static PyObject *__pyx_n_s_pyx_vtable;
2471 static PyObject *__pyx_n_s_range;
2472 static PyObject *__pyx_n_s_reduce;
2473 static PyObject *__pyx_n_s_reduce_cython;
2474 static PyObject *__pyx_n_s_reduce_ex;
2475 static PyObject *__pyx_n_s_resetBC;
2476 static PyObject *__pyx_n_s_self;
2477 static PyObject *__pyx_kp_s_self_uuOfXT_cannot_be_converted;
2478 static PyObject *__pyx_n_s_setConstantBC;
2479 static PyObject *__pyx_n_s_setConstantBC_locals_lambda;
2480 static PyObject *__pyx_n_s_setLinearBC;
2481 static PyObject *__pyx_n_s_setLinearBC_locals_lambda;
2482 static PyObject *__pyx_n_s_setstate;
2483 static PyObject *__pyx_n_s_setstate_cython;
2484 static PyObject *__pyx_n_s_shape;
2485 static PyObject *__pyx_n_s_size;
2486 static PyObject *__pyx_n_s_start;
2487 static PyObject *__pyx_n_s_state;
2488 static PyObject *__pyx_n_s_step;
2489 static PyObject *__pyx_n_s_stop;
2490 static PyObject *__pyx_kp_s_strided_and_direct;
2491 static PyObject *__pyx_kp_s_strided_and_direct_or_indirect;
2492 static PyObject *__pyx_kp_s_strided_and_indirect;
2493 static PyObject *__pyx_kp_s_stringsource;
2494 static PyObject *__pyx_n_s_struct;
2495 static PyObject *__pyx_n_s_t;
2496 static PyObject *__pyx_n_s_test;
2497 static PyObject *__pyx_kp_s_unable_to_allocate_array_data;
2498 static PyObject *__pyx_kp_s_unable_to_allocate_shape_and_str;
2499 static PyObject *__pyx_kp_u_unknown_dtype_code_in_numpy_pxd;
2500 static PyObject *__pyx_n_s_unpack;
2501 static PyObject *__pyx_n_s_update;
2502 static PyObject *__pyx_n_s_use_setstate;
2503 static PyObject *__pyx_n_s_value;
2504 static PyObject *__pyx_n_s_x;
2505 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd); /* proto */
2506 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context); /* proto */
2507 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2508 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2509 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2510 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2511 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2512 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2513 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2514 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2515 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2516 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2517 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2518 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2519 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2520 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2521 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self); /* proto */
2522 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2523 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2524 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2525 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2526 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
2527 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2528 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t); /* proto */
2529 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a1, PyObject *__pyx_v_i); /* proto */
2530 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2531 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value); /* proto */
2532 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2533 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self); /* proto */
2534 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2535 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2536 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2537 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info); /* proto */
2538 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer); /* proto */
2539 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2540 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2541 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2542 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self); /* proto */
2543 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr); /* proto */
2544 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item); /* proto */
2545 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /* proto */
2546 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self); /* proto */
2547 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2548 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name); /* proto */
2549 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2550 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self); /* proto */
2551 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state); /* proto */
2552 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object); /* proto */
2553 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2554 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index); /* proto */
2555 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /* proto */
2556 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /* proto */
2557 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2558 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2559 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2560 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2561 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2562 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2563 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2564 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2565 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2566 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2567 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2568 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2569 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2570 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2571 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2572 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2573 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self); /* proto */
2574 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2575 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2576 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2577 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self); /* proto */
2578 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state); /* proto */
2579 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state); /* proto */
2580 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2581 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2582 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2583 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2584 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2585 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2586 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2587 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k); /*proto*/
2588 static PyObject *__pyx_int_0;
2589 static PyObject *__pyx_int_1;
2590 static PyObject *__pyx_int_158231071;
2591 static PyObject *__pyx_int_184977713;
2592 static PyObject *__pyx_int_neg_1;
2593 static PyObject *__pyx_tuple_;
2594 static PyObject *__pyx_tuple__2;
2595 static PyObject *__pyx_tuple__3;
2596 static PyObject *__pyx_tuple__4;
2597 static PyObject *__pyx_tuple__5;
2598 static PyObject *__pyx_tuple__6;
2599 static PyObject *__pyx_tuple__7;
2600 static PyObject *__pyx_tuple__8;
2601 static PyObject *__pyx_tuple__9;
2602 static PyObject *__pyx_slice__27;
2603 static PyObject *__pyx_slice__28;
2604 static PyObject *__pyx_slice__29;
2605 static PyObject *__pyx_tuple__10;
2606 static PyObject *__pyx_tuple__11;
2607 static PyObject *__pyx_tuple__12;
2608 static PyObject *__pyx_tuple__13;
2609 static PyObject *__pyx_tuple__14;
2610 static PyObject *__pyx_tuple__15;
2611 static PyObject *__pyx_tuple__16;
2612 static PyObject *__pyx_tuple__17;
2613 static PyObject *__pyx_tuple__18;
2614 static PyObject *__pyx_tuple__19;
2615 static PyObject *__pyx_tuple__20;
2616 static PyObject *__pyx_tuple__21;
2617 static PyObject *__pyx_tuple__22;
2618 static PyObject *__pyx_tuple__23;
2619 static PyObject *__pyx_tuple__24;
2620 static PyObject *__pyx_tuple__25;
2621 static PyObject *__pyx_tuple__26;
2622 static PyObject *__pyx_tuple__30;
2623 static PyObject *__pyx_tuple__31;
2624 static PyObject *__pyx_tuple__32;
2625 static PyObject *__pyx_tuple__33;
2626 static PyObject *__pyx_tuple__35;
2627 static PyObject *__pyx_tuple__37;
2628 static PyObject *__pyx_tuple__39;
2629 static PyObject *__pyx_tuple__41;
2630 static PyObject *__pyx_tuple__43;
2631 static PyObject *__pyx_tuple__45;
2632 static PyObject *__pyx_tuple__47;
2633 static PyObject *__pyx_tuple__49;
2634 static PyObject *__pyx_tuple__51;
2635 static PyObject *__pyx_tuple__53;
2636 static PyObject *__pyx_tuple__54;
2637 static PyObject *__pyx_tuple__55;
2638 static PyObject *__pyx_tuple__56;
2639 static PyObject *__pyx_tuple__57;
2640 static PyObject *__pyx_tuple__58;
2641 static PyObject *__pyx_codeobj__34;
2642 static PyObject *__pyx_codeobj__36;
2643 static PyObject *__pyx_codeobj__38;
2644 static PyObject *__pyx_codeobj__40;
2645 static PyObject *__pyx_codeobj__42;
2646 static PyObject *__pyx_codeobj__44;
2647 static PyObject *__pyx_codeobj__46;
2648 static PyObject *__pyx_codeobj__48;
2649 static PyObject *__pyx_codeobj__50;
2650 static PyObject *__pyx_codeobj__52;
2651 static PyObject *__pyx_codeobj__59;
2652 /* Late includes */
2653 
2654 /* "BoundaryConditions.py":13
2655  * Generic class regrouping boundary conditions
2656  * """
2657  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
2658  * self.Shape = shape
2659  * self.name = name
2660  */
2661 
2662 /* Python wrapper */
2663 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2664 static int __pyx_pw_18BoundaryConditions_7BC_Base_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2665  PyObject *__pyx_v_shape = 0;
2666  PyObject *__pyx_v_name = 0;
2667  PyObject *__pyx_v_b_or = 0;
2668  PyObject *__pyx_v_b_i = 0;
2669  PyObject *__pyx_v_nd = 0;
2670  int __pyx_r;
2671  __Pyx_RefNannyDeclarations
2672  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
2673  {
2674  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_name,&__pyx_n_s_b_or,&__pyx_n_s_b_i,&__pyx_n_s_nd,0};
2675  PyObject* values[5] = {0,0,0,0,0};
2676  values[0] = ((PyObject *)Py_None);
2677  values[1] = ((PyObject *)Py_None);
2678  values[2] = ((PyObject *)Py_None);
2679  values[3] = ((PyObject *)__pyx_int_0);
2680  values[4] = ((PyObject *)Py_None);
2681  if (unlikely(__pyx_kwds)) {
2682  Py_ssize_t kw_args;
2683  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
2684  switch (pos_args) {
2685  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2686  CYTHON_FALLTHROUGH;
2687  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2688  CYTHON_FALLTHROUGH;
2689  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2690  CYTHON_FALLTHROUGH;
2691  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2692  CYTHON_FALLTHROUGH;
2693  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2694  CYTHON_FALLTHROUGH;
2695  case 0: break;
2696  default: goto __pyx_L5_argtuple_error;
2697  }
2698  kw_args = PyDict_Size(__pyx_kwds);
2699  switch (pos_args) {
2700  case 0:
2701  if (kw_args > 0) {
2702  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape);
2703  if (value) { values[0] = value; kw_args--; }
2704  }
2705  CYTHON_FALLTHROUGH;
2706  case 1:
2707  if (kw_args > 0) {
2708  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name);
2709  if (value) { values[1] = value; kw_args--; }
2710  }
2711  CYTHON_FALLTHROUGH;
2712  case 2:
2713  if (kw_args > 0) {
2714  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_or);
2715  if (value) { values[2] = value; kw_args--; }
2716  }
2717  CYTHON_FALLTHROUGH;
2718  case 3:
2719  if (kw_args > 0) {
2720  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_b_i);
2721  if (value) { values[3] = value; kw_args--; }
2722  }
2723  CYTHON_FALLTHROUGH;
2724  case 4:
2725  if (kw_args > 0) {
2726  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_nd);
2727  if (value) { values[4] = value; kw_args--; }
2728  }
2729  }
2730  if (unlikely(kw_args > 0)) {
2731  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(1, 13, __pyx_L3_error)
2732  }
2733  } else {
2734  switch (PyTuple_GET_SIZE(__pyx_args)) {
2735  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
2736  CYTHON_FALLTHROUGH;
2737  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
2738  CYTHON_FALLTHROUGH;
2739  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
2740  CYTHON_FALLTHROUGH;
2741  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
2742  CYTHON_FALLTHROUGH;
2743  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
2744  CYTHON_FALLTHROUGH;
2745  case 0: break;
2746  default: goto __pyx_L5_argtuple_error;
2747  }
2748  }
2749  __pyx_v_shape = values[0];
2750  __pyx_v_name = values[1];
2751  __pyx_v_b_or = values[2];
2752  __pyx_v_b_i = values[3];
2753  __pyx_v_nd = values[4];
2754  }
2755  goto __pyx_L4_argument_unpacking_done;
2756  __pyx_L5_argtuple_error:;
2757  __Pyx_RaiseArgtupleInvalid("__init__", 0, 0, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 13, __pyx_L3_error)
2758  __pyx_L3_error:;
2759  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2760  __Pyx_RefNannyFinishContext();
2761  return -1;
2762  __pyx_L4_argument_unpacking_done:;
2763  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base___init__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_shape, __pyx_v_name, __pyx_v_b_or, __pyx_v_b_i, __pyx_v_nd);
2764 
2765  /* function exit code */
2766  __Pyx_RefNannyFinishContext();
2767  return __pyx_r;
2768 }
2769 
2770 static int __pyx_pf_18BoundaryConditions_7BC_Base___init__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_shape, PyObject *__pyx_v_name, PyObject *__pyx_v_b_or, PyObject *__pyx_v_b_i, PyObject *__pyx_v_nd) {
2771  int __pyx_r;
2772  __Pyx_RefNannyDeclarations
2773  PyObject *__pyx_t_1 = NULL;
2774  int __pyx_t_2;
2775  int __pyx_t_3;
2776  PyObject *__pyx_t_4 = NULL;
2777  int __pyx_t_5;
2778  __Pyx_memviewslice __pyx_t_6 = { 0, 0, { 0 }, { 0 }, { 0 } };
2779  __Pyx_RefNannySetupContext("__init__", 0);
2780 
2781  /* "BoundaryConditions.py":14
2782  * """
2783  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
2784  * self.Shape = shape # <<<<<<<<<<<<<<
2785  * self.name = name
2786  * self.BC_type = 'None'
2787  */
2788  __Pyx_INCREF(__pyx_v_shape);
2789  __Pyx_GIVEREF(__pyx_v_shape);
2790  __Pyx_GOTREF(__pyx_v_self->Shape);
2791  __Pyx_DECREF(__pyx_v_self->Shape);
2792  __pyx_v_self->Shape = __pyx_v_shape;
2793 
2794  /* "BoundaryConditions.py":15
2795  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None):
2796  * self.Shape = shape
2797  * self.name = name # <<<<<<<<<<<<<<
2798  * self.BC_type = 'None'
2799  * if shape is not None:
2800  */
2801  if (!(likely(PyString_CheckExact(__pyx_v_name))||((__pyx_v_name) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_name)->tp_name), 0))) __PYX_ERR(1, 15, __pyx_L1_error)
2802  __pyx_t_1 = __pyx_v_name;
2803  __Pyx_INCREF(__pyx_t_1);
2804  __Pyx_GIVEREF(__pyx_t_1);
2805  __Pyx_GOTREF(__pyx_v_self->name);
2806  __Pyx_DECREF(__pyx_v_self->name);
2807  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
2808  __pyx_t_1 = 0;
2809 
2810  /* "BoundaryConditions.py":16
2811  * self.Shape = shape
2812  * self.name = name
2813  * self.BC_type = 'None' # <<<<<<<<<<<<<<
2814  * if shape is not None:
2815  * self.nd = self.Shape.Domain.nd
2816  */
2817  __Pyx_INCREF(__pyx_n_s_None);
2818  __Pyx_GIVEREF(__pyx_n_s_None);
2819  __Pyx_GOTREF(__pyx_v_self->BC_type);
2820  __Pyx_DECREF(__pyx_v_self->BC_type);
2821  __pyx_v_self->BC_type = __pyx_n_s_None;
2822 
2823  /* "BoundaryConditions.py":17
2824  * self.name = name
2825  * self.BC_type = 'None'
2826  * if shape is not None: # <<<<<<<<<<<<<<
2827  * self.nd = self.Shape.Domain.nd
2828  * elif nd is not None:
2829  */
2830  __pyx_t_2 = (__pyx_v_shape != Py_None);
2831  __pyx_t_3 = (__pyx_t_2 != 0);
2832  if (__pyx_t_3) {
2833 
2834  /* "BoundaryConditions.py":18
2835  * self.BC_type = 'None'
2836  * if shape is not None:
2837  * self.nd = self.Shape.Domain.nd # <<<<<<<<<<<<<<
2838  * elif nd is not None:
2839  * self.nd = nd
2840  */
2841  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_self->Shape, __pyx_n_s_Domain); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 18, __pyx_L1_error)
2842  __Pyx_GOTREF(__pyx_t_1);
2843  __pyx_t_4 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_nd); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 18, __pyx_L1_error)
2844  __Pyx_GOTREF(__pyx_t_4);
2845  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
2846  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_4); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 18, __pyx_L1_error)
2847  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2848  __pyx_v_self->nd = __pyx_t_5;
2849 
2850  /* "BoundaryConditions.py":17
2851  * self.name = name
2852  * self.BC_type = 'None'
2853  * if shape is not None: # <<<<<<<<<<<<<<
2854  * self.nd = self.Shape.Domain.nd
2855  * elif nd is not None:
2856  */
2857  goto __pyx_L3;
2858  }
2859 
2860  /* "BoundaryConditions.py":19
2861  * if shape is not None:
2862  * self.nd = self.Shape.Domain.nd
2863  * elif nd is not None: # <<<<<<<<<<<<<<
2864  * self.nd = nd
2865  * else:
2866  */
2867  __pyx_t_3 = (__pyx_v_nd != Py_None);
2868  __pyx_t_2 = (__pyx_t_3 != 0);
2869  if (__pyx_t_2) {
2870 
2871  /* "BoundaryConditions.py":20
2872  * self.nd = self.Shape.Domain.nd
2873  * elif nd is not None:
2874  * self.nd = nd # <<<<<<<<<<<<<<
2875  * else:
2876  * assert nd is not None, 'Shape or nd must be passed to BC'
2877  */
2878  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_v_nd); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(1, 20, __pyx_L1_error)
2879  __pyx_v_self->nd = __pyx_t_5;
2880 
2881  /* "BoundaryConditions.py":19
2882  * if shape is not None:
2883  * self.nd = self.Shape.Domain.nd
2884  * elif nd is not None: # <<<<<<<<<<<<<<
2885  * self.nd = nd
2886  * else:
2887  */
2888  goto __pyx_L3;
2889  }
2890 
2891  /* "BoundaryConditions.py":22
2892  * self.nd = nd
2893  * else:
2894  * assert nd is not None, 'Shape or nd must be passed to BC' # <<<<<<<<<<<<<<
2895  * if b_or is not None:
2896  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
2897  */
2898  /*else*/ {
2899  #ifndef CYTHON_WITHOUT_ASSERTIONS
2900  if (unlikely(!Py_OptimizeFlag)) {
2901  __pyx_t_2 = (__pyx_v_nd != Py_None);
2902  if (unlikely(!(__pyx_t_2 != 0))) {
2903  PyErr_SetObject(PyExc_AssertionError, __pyx_kp_s_Shape_or_nd_must_be_passed_to_BC);
2904  __PYX_ERR(1, 22, __pyx_L1_error)
2905  }
2906  }
2907  #endif
2908  }
2909  __pyx_L3:;
2910 
2911  /* "BoundaryConditions.py":23
2912  * else:
2913  * assert nd is not None, 'Shape or nd must be passed to BC'
2914  * if b_or is not None: # <<<<<<<<<<<<<<
2915  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
2916  * else:
2917  */
2918  __pyx_t_2 = (__pyx_v_b_or != Py_None);
2919  __pyx_t_3 = (__pyx_t_2 != 0);
2920  if (__pyx_t_3) {
2921 
2922  /* "BoundaryConditions.py":24
2923  * assert nd is not None, 'Shape or nd must be passed to BC'
2924  * if b_or is not None:
2925  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape # <<<<<<<<<<<<<<
2926  * else:
2927  * self._b_or = None
2928  */
2929  __pyx_t_4 = __Pyx_PyObject_GetItem(__pyx_v_b_or, __pyx_v_b_i); if (unlikely(!__pyx_t_4)) __PYX_ERR(1, 24, __pyx_L1_error)
2930  __Pyx_GOTREF(__pyx_t_4);
2931  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_4, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(1, 24, __pyx_L1_error)
2932  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
2933  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
2934  __pyx_v_self->_b_or = __pyx_t_6;
2935  __pyx_t_6.memview = NULL;
2936  __pyx_t_6.data = NULL;
2937 
2938  /* "BoundaryConditions.py":23
2939  * else:
2940  * assert nd is not None, 'Shape or nd must be passed to BC'
2941  * if b_or is not None: # <<<<<<<<<<<<<<
2942  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
2943  * else:
2944  */
2945  goto __pyx_L4;
2946  }
2947 
2948  /* "BoundaryConditions.py":26
2949  * self._b_or = b_or[b_i] # array of orientation of all boundaries of shape
2950  * else:
2951  * self._b_or = None # <<<<<<<<<<<<<<
2952  *
2953  * # @staticmethod
2954  */
2955  /*else*/ {
2956  __pyx_t_6 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(Py_None, PyBUF_WRITABLE); if (unlikely(!__pyx_t_6.memview)) __PYX_ERR(1, 26, __pyx_L1_error)
2957  __PYX_XDEC_MEMVIEW(&__pyx_v_self->_b_or, 0);
2958  __pyx_v_self->_b_or = __pyx_t_6;
2959  __pyx_t_6.memview = NULL;
2960  __pyx_t_6.data = NULL;
2961  }
2962  __pyx_L4:;
2963 
2964  /* "BoundaryConditions.py":13
2965  * Generic class regrouping boundary conditions
2966  * """
2967  * def __init__(self, shape=None, name=None, b_or=None, b_i=0, nd=None): # <<<<<<<<<<<<<<
2968  * self.Shape = shape
2969  * self.name = name
2970  */
2971 
2972  /* function exit code */
2973  __pyx_r = 0;
2974  goto __pyx_L0;
2975  __pyx_L1_error:;
2976  __Pyx_XDECREF(__pyx_t_1);
2977  __Pyx_XDECREF(__pyx_t_4);
2978  __PYX_XDEC_MEMVIEW(&__pyx_t_6, 1);
2979  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
2980  __pyx_r = -1;
2981  __pyx_L0:;
2982  __Pyx_RefNannyFinishContext();
2983  return __pyx_r;
2984 }
2985 
2986 /* "BoundaryConditions.py":41
2987  * # setattr(BC_Base, name, default_value)
2988  *
2989  * def getContext(self, context=None): # <<<<<<<<<<<<<<
2990  * """
2991  * Gets context from proteus.Context or
2992  */
2993 
2994 /* Python wrapper */
2995 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
2996 static char __pyx_doc_18BoundaryConditions_7BC_Base_2getContext[] = "\n Gets context from proteus.Context or\n\n Parameters\n ----------\n context: class, optional\n if set to None, the context will be created from proteus.Context\n ";
2997 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_3getContext = {"getContext", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext};
2998 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_3getContext(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
2999  PyObject *__pyx_v_context = 0;
3000  PyObject *__pyx_r = 0;
3001  __Pyx_RefNannyDeclarations
3002  __Pyx_RefNannySetupContext("getContext (wrapper)", 0);
3003  {
3004  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_context,0};
3005  PyObject* values[1] = {0};
3006  values[0] = ((PyObject *)Py_None);
3007  if (unlikely(__pyx_kwds)) {
3008  Py_ssize_t kw_args;
3009  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
3010  switch (pos_args) {
3011  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3012  CYTHON_FALLTHROUGH;
3013  case 0: break;
3014  default: goto __pyx_L5_argtuple_error;
3015  }
3016  kw_args = PyDict_Size(__pyx_kwds);
3017  switch (pos_args) {
3018  case 0:
3019  if (kw_args > 0) {
3020  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_context);
3021  if (value) { values[0] = value; kw_args--; }
3022  }
3023  }
3024  if (unlikely(kw_args > 0)) {
3025  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "getContext") < 0)) __PYX_ERR(1, 41, __pyx_L3_error)
3026  }
3027  } else {
3028  switch (PyTuple_GET_SIZE(__pyx_args)) {
3029  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
3030  CYTHON_FALLTHROUGH;
3031  case 0: break;
3032  default: goto __pyx_L5_argtuple_error;
3033  }
3034  }
3035  __pyx_v_context = values[0];
3036  }
3037  goto __pyx_L4_argument_unpacking_done;
3038  __pyx_L5_argtuple_error:;
3039  __Pyx_RaiseArgtupleInvalid("getContext", 0, 0, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 41, __pyx_L3_error)
3040  __pyx_L3_error:;
3041  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3042  __Pyx_RefNannyFinishContext();
3043  return NULL;
3044  __pyx_L4_argument_unpacking_done:;
3045  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2getContext(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), __pyx_v_context);
3046 
3047  /* function exit code */
3048  __Pyx_RefNannyFinishContext();
3049  return __pyx_r;
3050 }
3051 
3052 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2getContext(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_context) {
3053  PyObject *__pyx_v_Context = NULL;
3054  PyObject *__pyx_r = NULL;
3055  __Pyx_RefNannyDeclarations
3056  int __pyx_t_1;
3057  PyObject *__pyx_t_2 = NULL;
3058  PyObject *__pyx_t_3 = NULL;
3059  PyObject *__pyx_t_4 = NULL;
3060  __Pyx_RefNannySetupContext("getContext", 0);
3061 
3062  /* "BoundaryConditions.py":50
3063  * if set to None, the context will be created from proteus.Context
3064  * """
3065  * if context: # <<<<<<<<<<<<<<
3066  * from proteus import Context
3067  * self.ct = Context.get()
3068  */
3069  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_context); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(1, 50, __pyx_L1_error)
3070  if (__pyx_t_1) {
3071 
3072  /* "BoundaryConditions.py":51
3073  * """
3074  * if context:
3075  * from proteus import Context # <<<<<<<<<<<<<<
3076  * self.ct = Context.get()
3077  * else:
3078  */
3079  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
3080  __Pyx_GOTREF(__pyx_t_2);
3081  __Pyx_INCREF(__pyx_n_s_Context);
3082  __Pyx_GIVEREF(__pyx_n_s_Context);
3083  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_Context);
3084  __pyx_t_3 = __Pyx_Import(__pyx_n_s_proteus, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 51, __pyx_L1_error)
3085  __Pyx_GOTREF(__pyx_t_3);
3086  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3087  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_Context); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 51, __pyx_L1_error)
3088  __Pyx_GOTREF(__pyx_t_2);
3089  __Pyx_INCREF(__pyx_t_2);
3090  __pyx_v_Context = __pyx_t_2;
3091  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3092  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3093 
3094  /* "BoundaryConditions.py":52
3095  * if context:
3096  * from proteus import Context
3097  * self.ct = Context.get() # <<<<<<<<<<<<<<
3098  * else:
3099  * self.ct = context
3100  */
3101  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_v_Context, __pyx_n_s_get); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 52, __pyx_L1_error)
3102  __Pyx_GOTREF(__pyx_t_2);
3103  __pyx_t_4 = NULL;
3104  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
3105  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_2);
3106  if (likely(__pyx_t_4)) {
3107  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
3108  __Pyx_INCREF(__pyx_t_4);
3109  __Pyx_INCREF(function);
3110  __Pyx_DECREF_SET(__pyx_t_2, function);
3111  }
3112  }
3113  if (__pyx_t_4) {
3114  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error)
3115  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
3116  } else {
3117  __pyx_t_3 = __Pyx_PyObject_CallNoArg(__pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(1, 52, __pyx_L1_error)
3118  }
3119  __Pyx_GOTREF(__pyx_t_3);
3120  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3121  __Pyx_GIVEREF(__pyx_t_3);
3122  __Pyx_GOTREF(__pyx_v_self->ct);
3123  __Pyx_DECREF(__pyx_v_self->ct);
3124  __pyx_v_self->ct = __pyx_t_3;
3125  __pyx_t_3 = 0;
3126 
3127  /* "BoundaryConditions.py":50
3128  * if set to None, the context will be created from proteus.Context
3129  * """
3130  * if context: # <<<<<<<<<<<<<<
3131  * from proteus import Context
3132  * self.ct = Context.get()
3133  */
3134  goto __pyx_L3;
3135  }
3136 
3137  /* "BoundaryConditions.py":54
3138  * self.ct = Context.get()
3139  * else:
3140  * self.ct = context # <<<<<<<<<<<<<<
3141  *
3142  *
3143  */
3144  /*else*/ {
3145  __Pyx_INCREF(__pyx_v_context);
3146  __Pyx_GIVEREF(__pyx_v_context);
3147  __Pyx_GOTREF(__pyx_v_self->ct);
3148  __Pyx_DECREF(__pyx_v_self->ct);
3149  __pyx_v_self->ct = __pyx_v_context;
3150  }
3151  __pyx_L3:;
3152 
3153  /* "BoundaryConditions.py":41
3154  * # setattr(BC_Base, name, default_value)
3155  *
3156  * def getContext(self, context=None): # <<<<<<<<<<<<<<
3157  * """
3158  * Gets context from proteus.Context or
3159  */
3160 
3161  /* function exit code */
3162  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3163  goto __pyx_L0;
3164  __pyx_L1_error:;
3165  __Pyx_XDECREF(__pyx_t_2);
3166  __Pyx_XDECREF(__pyx_t_3);
3167  __Pyx_XDECREF(__pyx_t_4);
3168  __Pyx_AddTraceback("BoundaryConditions.BC_Base.getContext", __pyx_clineno, __pyx_lineno, __pyx_filename);
3169  __pyx_r = NULL;
3170  __pyx_L0:;
3171  __Pyx_XDECREF(__pyx_v_Context);
3172  __Pyx_XGIVEREF(__pyx_r);
3173  __Pyx_RefNannyFinishContext();
3174  return __pyx_r;
3175 }
3176 
3177 /* "BoundaryConditions.pxd":8
3178  * cdef double[:] _b_or
3179  * cdef public:
3180  * cdef int nd # <<<<<<<<<<<<<<
3181  * object Shape
3182  * str name
3183  */
3184 
3185 /* Python wrapper */
3186 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self); /*proto*/
3187 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(PyObject *__pyx_v_self) {
3188  PyObject *__pyx_r = 0;
3189  __Pyx_RefNannyDeclarations
3190  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3191  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3192 
3193  /* function exit code */
3194  __Pyx_RefNannyFinishContext();
3195  return __pyx_r;
3196 }
3197 
3198 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2nd___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3199  PyObject *__pyx_r = NULL;
3200  __Pyx_RefNannyDeclarations
3201  PyObject *__pyx_t_1 = NULL;
3202  __Pyx_RefNannySetupContext("__get__", 0);
3203  __Pyx_XDECREF(__pyx_r);
3204  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_1)) __PYX_ERR(2, 8, __pyx_L1_error)
3205  __Pyx_GOTREF(__pyx_t_1);
3206  __pyx_r = __pyx_t_1;
3207  __pyx_t_1 = 0;
3208  goto __pyx_L0;
3209 
3210  /* function exit code */
3211  __pyx_L1_error:;
3212  __Pyx_XDECREF(__pyx_t_1);
3213  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3214  __pyx_r = NULL;
3215  __pyx_L0:;
3216  __Pyx_XGIVEREF(__pyx_r);
3217  __Pyx_RefNannyFinishContext();
3218  return __pyx_r;
3219 }
3220 
3221 /* Python wrapper */
3222 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3223 static int __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3224  int __pyx_r;
3225  __Pyx_RefNannyDeclarations
3226  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3227  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3228 
3229  /* function exit code */
3230  __Pyx_RefNannyFinishContext();
3231  return __pyx_r;
3232 }
3233 
3234 static int __pyx_pf_18BoundaryConditions_7BC_Base_2nd_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3235  int __pyx_r;
3236  __Pyx_RefNannyDeclarations
3237  int __pyx_t_1;
3238  __Pyx_RefNannySetupContext("__set__", 0);
3239  __pyx_t_1 = __Pyx_PyInt_As_int(__pyx_v_value); if (unlikely((__pyx_t_1 == (int)-1) && PyErr_Occurred())) __PYX_ERR(2, 8, __pyx_L1_error)
3240  __pyx_v_self->nd = __pyx_t_1;
3241 
3242  /* function exit code */
3243  __pyx_r = 0;
3244  goto __pyx_L0;
3245  __pyx_L1_error:;
3246  __Pyx_AddTraceback("BoundaryConditions.BC_Base.nd.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3247  __pyx_r = -1;
3248  __pyx_L0:;
3249  __Pyx_RefNannyFinishContext();
3250  return __pyx_r;
3251 }
3252 
3253 /* "BoundaryConditions.pxd":9
3254  * cdef public:
3255  * cdef int nd
3256  * object Shape # <<<<<<<<<<<<<<
3257  * str name
3258  * str BC_type
3259  */
3260 
3261 /* Python wrapper */
3262 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self); /*proto*/
3263 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(PyObject *__pyx_v_self) {
3264  PyObject *__pyx_r = 0;
3265  __Pyx_RefNannyDeclarations
3266  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3267  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3268 
3269  /* function exit code */
3270  __Pyx_RefNannyFinishContext();
3271  return __pyx_r;
3272 }
3273 
3274 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_5Shape___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3275  PyObject *__pyx_r = NULL;
3276  __Pyx_RefNannyDeclarations
3277  __Pyx_RefNannySetupContext("__get__", 0);
3278  __Pyx_XDECREF(__pyx_r);
3279  __Pyx_INCREF(__pyx_v_self->Shape);
3280  __pyx_r = __pyx_v_self->Shape;
3281  goto __pyx_L0;
3282 
3283  /* function exit code */
3284  __pyx_L0:;
3285  __Pyx_XGIVEREF(__pyx_r);
3286  __Pyx_RefNannyFinishContext();
3287  return __pyx_r;
3288 }
3289 
3290 /* Python wrapper */
3291 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3292 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3293  int __pyx_r;
3294  __Pyx_RefNannyDeclarations
3295  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3296  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3297 
3298  /* function exit code */
3299  __Pyx_RefNannyFinishContext();
3300  return __pyx_r;
3301 }
3302 
3303 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3304  int __pyx_r;
3305  __Pyx_RefNannyDeclarations
3306  __Pyx_RefNannySetupContext("__set__", 0);
3307  __Pyx_INCREF(__pyx_v_value);
3308  __Pyx_GIVEREF(__pyx_v_value);
3309  __Pyx_GOTREF(__pyx_v_self->Shape);
3310  __Pyx_DECREF(__pyx_v_self->Shape);
3311  __pyx_v_self->Shape = __pyx_v_value;
3312 
3313  /* function exit code */
3314  __pyx_r = 0;
3315  __Pyx_RefNannyFinishContext();
3316  return __pyx_r;
3317 }
3318 
3319 /* Python wrapper */
3320 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self); /*proto*/
3321 static int __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(PyObject *__pyx_v_self) {
3322  int __pyx_r;
3323  __Pyx_RefNannyDeclarations
3324  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3325  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3326 
3327  /* function exit code */
3328  __Pyx_RefNannyFinishContext();
3329  return __pyx_r;
3330 }
3331 
3332 static int __pyx_pf_18BoundaryConditions_7BC_Base_5Shape_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3333  int __pyx_r;
3334  __Pyx_RefNannyDeclarations
3335  __Pyx_RefNannySetupContext("__del__", 0);
3336  __Pyx_INCREF(Py_None);
3337  __Pyx_GIVEREF(Py_None);
3338  __Pyx_GOTREF(__pyx_v_self->Shape);
3339  __Pyx_DECREF(__pyx_v_self->Shape);
3340  __pyx_v_self->Shape = Py_None;
3341 
3342  /* function exit code */
3343  __pyx_r = 0;
3344  __Pyx_RefNannyFinishContext();
3345  return __pyx_r;
3346 }
3347 
3348 /* "BoundaryConditions.pxd":10
3349  * cdef int nd
3350  * object Shape
3351  * str name # <<<<<<<<<<<<<<
3352  * str BC_type
3353  * object ct
3354  */
3355 
3356 /* Python wrapper */
3357 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self); /*proto*/
3358 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(PyObject *__pyx_v_self) {
3359  PyObject *__pyx_r = 0;
3360  __Pyx_RefNannyDeclarations
3361  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3362  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3363 
3364  /* function exit code */
3365  __Pyx_RefNannyFinishContext();
3366  return __pyx_r;
3367 }
3368 
3369 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4name___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3370  PyObject *__pyx_r = NULL;
3371  __Pyx_RefNannyDeclarations
3372  __Pyx_RefNannySetupContext("__get__", 0);
3373  __Pyx_XDECREF(__pyx_r);
3374  __Pyx_INCREF(__pyx_v_self->name);
3375  __pyx_r = __pyx_v_self->name;
3376  goto __pyx_L0;
3377 
3378  /* function exit code */
3379  __pyx_L0:;
3380  __Pyx_XGIVEREF(__pyx_r);
3381  __Pyx_RefNannyFinishContext();
3382  return __pyx_r;
3383 }
3384 
3385 /* Python wrapper */
3386 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3387 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3388  int __pyx_r;
3389  __Pyx_RefNannyDeclarations
3390  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3391  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3392 
3393  /* function exit code */
3394  __Pyx_RefNannyFinishContext();
3395  return __pyx_r;
3396 }
3397 
3398 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3399  int __pyx_r;
3400  __Pyx_RefNannyDeclarations
3401  PyObject *__pyx_t_1 = NULL;
3402  __Pyx_RefNannySetupContext("__set__", 0);
3403  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 10, __pyx_L1_error)
3404  __pyx_t_1 = __pyx_v_value;
3405  __Pyx_INCREF(__pyx_t_1);
3406  __Pyx_GIVEREF(__pyx_t_1);
3407  __Pyx_GOTREF(__pyx_v_self->name);
3408  __Pyx_DECREF(__pyx_v_self->name);
3409  __pyx_v_self->name = ((PyObject*)__pyx_t_1);
3410  __pyx_t_1 = 0;
3411 
3412  /* function exit code */
3413  __pyx_r = 0;
3414  goto __pyx_L0;
3415  __pyx_L1_error:;
3416  __Pyx_XDECREF(__pyx_t_1);
3417  __Pyx_AddTraceback("BoundaryConditions.BC_Base.name.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3418  __pyx_r = -1;
3419  __pyx_L0:;
3420  __Pyx_RefNannyFinishContext();
3421  return __pyx_r;
3422 }
3423 
3424 /* Python wrapper */
3425 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self); /*proto*/
3426 static int __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(PyObject *__pyx_v_self) {
3427  int __pyx_r;
3428  __Pyx_RefNannyDeclarations
3429  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3430  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3431 
3432  /* function exit code */
3433  __Pyx_RefNannyFinishContext();
3434  return __pyx_r;
3435 }
3436 
3437 static int __pyx_pf_18BoundaryConditions_7BC_Base_4name_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3438  int __pyx_r;
3439  __Pyx_RefNannyDeclarations
3440  __Pyx_RefNannySetupContext("__del__", 0);
3441  __Pyx_INCREF(Py_None);
3442  __Pyx_GIVEREF(Py_None);
3443  __Pyx_GOTREF(__pyx_v_self->name);
3444  __Pyx_DECREF(__pyx_v_self->name);
3445  __pyx_v_self->name = ((PyObject*)Py_None);
3446 
3447  /* function exit code */
3448  __pyx_r = 0;
3449  __Pyx_RefNannyFinishContext();
3450  return __pyx_r;
3451 }
3452 
3453 /* "BoundaryConditions.pxd":11
3454  * object Shape
3455  * str name
3456  * str BC_type # <<<<<<<<<<<<<<
3457  * object ct
3458  * # cpdef void newGlobalBC(BC_Base cls, str name, object default_value)
3459  */
3460 
3461 /* Python wrapper */
3462 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self); /*proto*/
3463 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(PyObject *__pyx_v_self) {
3464  PyObject *__pyx_r = 0;
3465  __Pyx_RefNannyDeclarations
3466  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3467  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3468 
3469  /* function exit code */
3470  __Pyx_RefNannyFinishContext();
3471  return __pyx_r;
3472 }
3473 
3474 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_7BC_type___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3475  PyObject *__pyx_r = NULL;
3476  __Pyx_RefNannyDeclarations
3477  __Pyx_RefNannySetupContext("__get__", 0);
3478  __Pyx_XDECREF(__pyx_r);
3479  __Pyx_INCREF(__pyx_v_self->BC_type);
3480  __pyx_r = __pyx_v_self->BC_type;
3481  goto __pyx_L0;
3482 
3483  /* function exit code */
3484  __pyx_L0:;
3485  __Pyx_XGIVEREF(__pyx_r);
3486  __Pyx_RefNannyFinishContext();
3487  return __pyx_r;
3488 }
3489 
3490 /* Python wrapper */
3491 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3492 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3493  int __pyx_r;
3494  __Pyx_RefNannyDeclarations
3495  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3496  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3497 
3498  /* function exit code */
3499  __Pyx_RefNannyFinishContext();
3500  return __pyx_r;
3501 }
3502 
3503 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3504  int __pyx_r;
3505  __Pyx_RefNannyDeclarations
3506  PyObject *__pyx_t_1 = NULL;
3507  __Pyx_RefNannySetupContext("__set__", 0);
3508  if (!(likely(PyString_CheckExact(__pyx_v_value))||((__pyx_v_value) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_v_value)->tp_name), 0))) __PYX_ERR(2, 11, __pyx_L1_error)
3509  __pyx_t_1 = __pyx_v_value;
3510  __Pyx_INCREF(__pyx_t_1);
3511  __Pyx_GIVEREF(__pyx_t_1);
3512  __Pyx_GOTREF(__pyx_v_self->BC_type);
3513  __Pyx_DECREF(__pyx_v_self->BC_type);
3514  __pyx_v_self->BC_type = ((PyObject*)__pyx_t_1);
3515  __pyx_t_1 = 0;
3516 
3517  /* function exit code */
3518  __pyx_r = 0;
3519  goto __pyx_L0;
3520  __pyx_L1_error:;
3521  __Pyx_XDECREF(__pyx_t_1);
3522  __Pyx_AddTraceback("BoundaryConditions.BC_Base.BC_type.__set__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3523  __pyx_r = -1;
3524  __pyx_L0:;
3525  __Pyx_RefNannyFinishContext();
3526  return __pyx_r;
3527 }
3528 
3529 /* Python wrapper */
3530 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self); /*proto*/
3531 static int __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(PyObject *__pyx_v_self) {
3532  int __pyx_r;
3533  __Pyx_RefNannyDeclarations
3534  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3535  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3536 
3537  /* function exit code */
3538  __Pyx_RefNannyFinishContext();
3539  return __pyx_r;
3540 }
3541 
3542 static int __pyx_pf_18BoundaryConditions_7BC_Base_7BC_type_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3543  int __pyx_r;
3544  __Pyx_RefNannyDeclarations
3545  __Pyx_RefNannySetupContext("__del__", 0);
3546  __Pyx_INCREF(Py_None);
3547  __Pyx_GIVEREF(Py_None);
3548  __Pyx_GOTREF(__pyx_v_self->BC_type);
3549  __Pyx_DECREF(__pyx_v_self->BC_type);
3550  __pyx_v_self->BC_type = ((PyObject*)Py_None);
3551 
3552  /* function exit code */
3553  __pyx_r = 0;
3554  __Pyx_RefNannyFinishContext();
3555  return __pyx_r;
3556 }
3557 
3558 /* "BoundaryConditions.pxd":12
3559  * str name
3560  * str BC_type
3561  * object ct # <<<<<<<<<<<<<<
3562  * # cpdef void newGlobalBC(BC_Base cls, str name, object default_value)
3563  * # cpdef void getContext(BC_Base cls, object context=*)
3564  */
3565 
3566 /* Python wrapper */
3567 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self); /*proto*/
3568 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(PyObject *__pyx_v_self) {
3569  PyObject *__pyx_r = 0;
3570  __Pyx_RefNannyDeclarations
3571  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
3572  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3573 
3574  /* function exit code */
3575  __Pyx_RefNannyFinishContext();
3576  return __pyx_r;
3577 }
3578 
3579 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_2ct___get__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3580  PyObject *__pyx_r = NULL;
3581  __Pyx_RefNannyDeclarations
3582  __Pyx_RefNannySetupContext("__get__", 0);
3583  __Pyx_XDECREF(__pyx_r);
3584  __Pyx_INCREF(__pyx_v_self->ct);
3585  __pyx_r = __pyx_v_self->ct;
3586  goto __pyx_L0;
3587 
3588  /* function exit code */
3589  __pyx_L0:;
3590  __Pyx_XGIVEREF(__pyx_r);
3591  __Pyx_RefNannyFinishContext();
3592  return __pyx_r;
3593 }
3594 
3595 /* Python wrapper */
3596 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
3597 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
3598  int __pyx_r;
3599  __Pyx_RefNannyDeclarations
3600  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
3601  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v_value));
3602 
3603  /* function exit code */
3604  __Pyx_RefNannyFinishContext();
3605  return __pyx_r;
3606 }
3607 
3608 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_2__set__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v_value) {
3609  int __pyx_r;
3610  __Pyx_RefNannyDeclarations
3611  __Pyx_RefNannySetupContext("__set__", 0);
3612  __Pyx_INCREF(__pyx_v_value);
3613  __Pyx_GIVEREF(__pyx_v_value);
3614  __Pyx_GOTREF(__pyx_v_self->ct);
3615  __Pyx_DECREF(__pyx_v_self->ct);
3616  __pyx_v_self->ct = __pyx_v_value;
3617 
3618  /* function exit code */
3619  __pyx_r = 0;
3620  __Pyx_RefNannyFinishContext();
3621  return __pyx_r;
3622 }
3623 
3624 /* Python wrapper */
3625 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self); /*proto*/
3626 static int __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(PyObject *__pyx_v_self) {
3627  int __pyx_r;
3628  __Pyx_RefNannyDeclarations
3629  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
3630  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3631 
3632  /* function exit code */
3633  __Pyx_RefNannyFinishContext();
3634  return __pyx_r;
3635 }
3636 
3637 static int __pyx_pf_18BoundaryConditions_7BC_Base_2ct_4__del__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3638  int __pyx_r;
3639  __Pyx_RefNannyDeclarations
3640  __Pyx_RefNannySetupContext("__del__", 0);
3641  __Pyx_INCREF(Py_None);
3642  __Pyx_GIVEREF(Py_None);
3643  __Pyx_GOTREF(__pyx_v_self->ct);
3644  __Pyx_DECREF(__pyx_v_self->ct);
3645  __pyx_v_self->ct = Py_None;
3646 
3647  /* function exit code */
3648  __pyx_r = 0;
3649  __Pyx_RefNannyFinishContext();
3650  return __pyx_r;
3651 }
3652 
3653 /* "(tree fragment)":1
3654  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3655  * cdef bint use_setstate
3656  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3657  */
3658 
3659 /* Python wrapper */
3660 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
3661 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, 0};
3662 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
3663  PyObject *__pyx_r = 0;
3664  __Pyx_RefNannyDeclarations
3665  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
3666  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self));
3667 
3668  /* function exit code */
3669  __Pyx_RefNannyFinishContext();
3670  return __pyx_r;
3671 }
3672 
3673 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_4__reduce_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self) {
3674  int __pyx_v_use_setstate;
3675  PyObject *__pyx_v_state = NULL;
3676  PyObject *__pyx_v__dict = NULL;
3677  PyObject *__pyx_r = NULL;
3678  __Pyx_RefNannyDeclarations
3679  PyObject *__pyx_t_1 = NULL;
3680  PyObject *__pyx_t_2 = NULL;
3681  PyObject *__pyx_t_3 = NULL;
3682  int __pyx_t_4;
3683  int __pyx_t_5;
3684  int __pyx_t_6;
3685  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
3686 
3687  /* "(tree fragment)":3
3688  * def __reduce_cython__(self):
3689  * cdef bint use_setstate
3690  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd) # <<<<<<<<<<<<<<
3691  * _dict = getattr(self, '__dict__', None)
3692  * if _dict is not None:
3693  */
3694  if (unlikely(!__pyx_v_self->_b_or.memview)) {PyErr_SetString(PyExc_AttributeError,"Memoryview is not initialized");__PYX_ERR(0, 3, __pyx_L1_error)}
3695  __pyx_t_1 = __pyx_memoryview_fromslice(__pyx_v_self->_b_or, 1, (PyObject *(*)(char *)) __pyx_memview_get_double, (int (*)(char *, PyObject *)) __pyx_memview_set_double, 0);; if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
3696  __Pyx_GOTREF(__pyx_t_1);
3697  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->nd); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
3698  __Pyx_GOTREF(__pyx_t_2);
3699  __pyx_t_3 = PyTuple_New(6); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error)
3700  __Pyx_GOTREF(__pyx_t_3);
3701  __Pyx_INCREF(__pyx_v_self->BC_type);
3702  __Pyx_GIVEREF(__pyx_v_self->BC_type);
3703  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_self->BC_type);
3704  __Pyx_INCREF(__pyx_v_self->Shape);
3705  __Pyx_GIVEREF(__pyx_v_self->Shape);
3706  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_v_self->Shape);
3707  __Pyx_GIVEREF(__pyx_t_1);
3708  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_1);
3709  __Pyx_INCREF(__pyx_v_self->ct);
3710  __Pyx_GIVEREF(__pyx_v_self->ct);
3711  PyTuple_SET_ITEM(__pyx_t_3, 3, __pyx_v_self->ct);
3712  __Pyx_INCREF(__pyx_v_self->name);
3713  __Pyx_GIVEREF(__pyx_v_self->name);
3714  PyTuple_SET_ITEM(__pyx_t_3, 4, __pyx_v_self->name);
3715  __Pyx_GIVEREF(__pyx_t_2);
3716  PyTuple_SET_ITEM(__pyx_t_3, 5, __pyx_t_2);
3717  __pyx_t_1 = 0;
3718  __pyx_t_2 = 0;
3719  __pyx_v_state = ((PyObject*)__pyx_t_3);
3720  __pyx_t_3 = 0;
3721 
3722  /* "(tree fragment)":4
3723  * cdef bint use_setstate
3724  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3725  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
3726  * if _dict is not None:
3727  * state += (_dict,)
3728  */
3729  __pyx_t_3 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
3730  __Pyx_GOTREF(__pyx_t_3);
3731  __pyx_v__dict = __pyx_t_3;
3732  __pyx_t_3 = 0;
3733 
3734  /* "(tree fragment)":5
3735  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3736  * _dict = getattr(self, '__dict__', None)
3737  * if _dict is not None: # <<<<<<<<<<<<<<
3738  * state += (_dict,)
3739  * use_setstate = True
3740  */
3741  __pyx_t_4 = (__pyx_v__dict != Py_None);
3742  __pyx_t_5 = (__pyx_t_4 != 0);
3743  if (__pyx_t_5) {
3744 
3745  /* "(tree fragment)":6
3746  * _dict = getattr(self, '__dict__', None)
3747  * if _dict is not None:
3748  * state += (_dict,) # <<<<<<<<<<<<<<
3749  * use_setstate = True
3750  * else:
3751  */
3752  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 6, __pyx_L1_error)
3753  __Pyx_GOTREF(__pyx_t_3);
3754  __Pyx_INCREF(__pyx_v__dict);
3755  __Pyx_GIVEREF(__pyx_v__dict);
3756  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v__dict);
3757  __pyx_t_2 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 6, __pyx_L1_error)
3758  __Pyx_GOTREF(__pyx_t_2);
3759  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
3760  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_2));
3761  __pyx_t_2 = 0;
3762 
3763  /* "(tree fragment)":7
3764  * if _dict is not None:
3765  * state += (_dict,)
3766  * use_setstate = True # <<<<<<<<<<<<<<
3767  * else:
3768  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
3769  */
3770  __pyx_v_use_setstate = 1;
3771 
3772  /* "(tree fragment)":5
3773  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3774  * _dict = getattr(self, '__dict__', None)
3775  * if _dict is not None: # <<<<<<<<<<<<<<
3776  * state += (_dict,)
3777  * use_setstate = True
3778  */
3779  goto __pyx_L3;
3780  }
3781 
3782  /* "(tree fragment)":9
3783  * use_setstate = True
3784  * else:
3785  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None # <<<<<<<<<<<<<<
3786  * if use_setstate:
3787  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
3788  */
3789  /*else*/ {
3790  __pyx_t_4 = (__pyx_v_self->BC_type != ((PyObject*)Py_None));
3791  __pyx_t_6 = (__pyx_t_4 != 0);
3792  if (!__pyx_t_6) {
3793  } else {
3794  __pyx_t_5 = __pyx_t_6;
3795  goto __pyx_L4_bool_binop_done;
3796  }
3797  __pyx_t_6 = (__pyx_v_self->Shape != Py_None);
3798  __pyx_t_4 = (__pyx_t_6 != 0);
3799  if (!__pyx_t_4) {
3800  } else {
3801  __pyx_t_5 = __pyx_t_4;
3802  goto __pyx_L4_bool_binop_done;
3803  }
3804  __pyx_t_4 = (__pyx_v_self->ct != Py_None);
3805  __pyx_t_6 = (__pyx_t_4 != 0);
3806  if (!__pyx_t_6) {
3807  } else {
3808  __pyx_t_5 = __pyx_t_6;
3809  goto __pyx_L4_bool_binop_done;
3810  }
3811  __pyx_t_6 = (__pyx_v_self->name != ((PyObject*)Py_None));
3812  __pyx_t_4 = (__pyx_t_6 != 0);
3813  __pyx_t_5 = __pyx_t_4;
3814  __pyx_L4_bool_binop_done:;
3815  __pyx_v_use_setstate = __pyx_t_5;
3816  }
3817  __pyx_L3:;
3818 
3819  /* "(tree fragment)":10
3820  * else:
3821  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
3822  * if use_setstate: # <<<<<<<<<<<<<<
3823  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
3824  * else:
3825  */
3826  __pyx_t_5 = (__pyx_v_use_setstate != 0);
3827  if (__pyx_t_5) {
3828 
3829  /* "(tree fragment)":11
3830  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
3831  * if use_setstate:
3832  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state # <<<<<<<<<<<<<<
3833  * else:
3834  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
3835  */
3836  __Pyx_XDECREF(__pyx_r);
3837  __pyx_t_2 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 11, __pyx_L1_error)
3838  __Pyx_GOTREF(__pyx_t_2);
3839  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 11, __pyx_L1_error)
3840  __Pyx_GOTREF(__pyx_t_3);
3841  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3842  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3843  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3844  __Pyx_INCREF(__pyx_int_158231071);
3845  __Pyx_GIVEREF(__pyx_int_158231071);
3846  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
3847  __Pyx_INCREF(Py_None);
3848  __Pyx_GIVEREF(Py_None);
3849  PyTuple_SET_ITEM(__pyx_t_3, 2, Py_None);
3850  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
3851  __Pyx_GOTREF(__pyx_t_1);
3852  __Pyx_GIVEREF(__pyx_t_2);
3853  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_t_2);
3854  __Pyx_GIVEREF(__pyx_t_3);
3855  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_t_3);
3856  __Pyx_INCREF(__pyx_v_state);
3857  __Pyx_GIVEREF(__pyx_v_state);
3858  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
3859  __pyx_t_2 = 0;
3860  __pyx_t_3 = 0;
3861  __pyx_r = __pyx_t_1;
3862  __pyx_t_1 = 0;
3863  goto __pyx_L0;
3864 
3865  /* "(tree fragment)":10
3866  * else:
3867  * use_setstate = self.BC_type is not None or self.Shape is not None or self.ct is not None or self.name is not None
3868  * if use_setstate: # <<<<<<<<<<<<<<
3869  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
3870  * else:
3871  */
3872  }
3873 
3874  /* "(tree fragment)":13
3875  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, None), state
3876  * else:
3877  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state) # <<<<<<<<<<<<<<
3878  * def __setstate_cython__(self, __pyx_state):
3879  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
3880  */
3881  /*else*/ {
3882  __Pyx_XDECREF(__pyx_r);
3883  __pyx_t_1 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_BC_Base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
3884  __Pyx_GOTREF(__pyx_t_1);
3885  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 13, __pyx_L1_error)
3886  __Pyx_GOTREF(__pyx_t_3);
3887  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3888  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3889  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
3890  __Pyx_INCREF(__pyx_int_158231071);
3891  __Pyx_GIVEREF(__pyx_int_158231071);
3892  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_158231071);
3893  __Pyx_INCREF(__pyx_v_state);
3894  __Pyx_GIVEREF(__pyx_v_state);
3895  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_v_state);
3896  __pyx_t_2 = PyTuple_New(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 13, __pyx_L1_error)
3897  __Pyx_GOTREF(__pyx_t_2);
3898  __Pyx_GIVEREF(__pyx_t_1);
3899  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
3900  __Pyx_GIVEREF(__pyx_t_3);
3901  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_3);
3902  __pyx_t_1 = 0;
3903  __pyx_t_3 = 0;
3904  __pyx_r = __pyx_t_2;
3905  __pyx_t_2 = 0;
3906  goto __pyx_L0;
3907  }
3908 
3909  /* "(tree fragment)":1
3910  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
3911  * cdef bint use_setstate
3912  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
3913  */
3914 
3915  /* function exit code */
3916  __pyx_L1_error:;
3917  __Pyx_XDECREF(__pyx_t_1);
3918  __Pyx_XDECREF(__pyx_t_2);
3919  __Pyx_XDECREF(__pyx_t_3);
3920  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3921  __pyx_r = NULL;
3922  __pyx_L0:;
3923  __Pyx_XDECREF(__pyx_v_state);
3924  __Pyx_XDECREF(__pyx_v__dict);
3925  __Pyx_XGIVEREF(__pyx_r);
3926  __Pyx_RefNannyFinishContext();
3927  return __pyx_r;
3928 }
3929 
3930 /* "(tree fragment)":14
3931  * else:
3932  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
3933  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3934  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
3935  */
3936 
3937 /* Python wrapper */
3938 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
3939 static PyMethodDef __pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, 0};
3940 static PyObject *__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3941  PyObject *__pyx_r = 0;
3942  __Pyx_RefNannyDeclarations
3943  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
3944  __pyx_r = __pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
3945 
3946  /* function exit code */
3947  __Pyx_RefNannyFinishContext();
3948  return __pyx_r;
3949 }
3950 
3951 static PyObject *__pyx_pf_18BoundaryConditions_7BC_Base_6__setstate_cython__(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
3952  PyObject *__pyx_r = NULL;
3953  __Pyx_RefNannyDeclarations
3954  PyObject *__pyx_t_1 = NULL;
3955  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
3956 
3957  /* "(tree fragment)":15
3958  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
3959  * def __setstate_cython__(self, __pyx_state):
3960  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
3961  */
3962  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 15, __pyx_L1_error)
3963  __pyx_t_1 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
3964  __Pyx_GOTREF(__pyx_t_1);
3965  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
3966 
3967  /* "(tree fragment)":14
3968  * else:
3969  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
3970  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
3971  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
3972  */
3973 
3974  /* function exit code */
3975  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
3976  goto __pyx_L0;
3977  __pyx_L1_error:;
3978  __Pyx_XDECREF(__pyx_t_1);
3979  __Pyx_AddTraceback("BoundaryConditions.BC_Base.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
3980  __pyx_r = NULL;
3981  __pyx_L0:;
3982  __Pyx_XGIVEREF(__pyx_r);
3983  __Pyx_RefNannyFinishContext();
3984  return __pyx_r;
3985 }
3986 
3987 /* "BoundaryConditions.py":67
3988  * no boundary condition
3989  * """
3990  * def __init__(self): # <<<<<<<<<<<<<<
3991  * self.uOfXT = None
3992  *
3993  */
3994 
3995 /* Python wrapper */
3996 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
3997 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
3998  int __pyx_r;
3999  __Pyx_RefNannyDeclarations
4000  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
4001  if (unlikely(PyTuple_GET_SIZE(__pyx_args) > 0)) {
4002  __Pyx_RaiseArgtupleInvalid("__init__", 1, 0, 0, PyTuple_GET_SIZE(__pyx_args)); return -1;}
4003  if (unlikely(__pyx_kwds) && unlikely(PyDict_Size(__pyx_kwds) > 0) && unlikely(!__Pyx_CheckKeywordStrings(__pyx_kwds, "__init__", 0))) return -1;
4004  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4005 
4006  /* function exit code */
4007  __Pyx_RefNannyFinishContext();
4008  return __pyx_r;
4009 }
4010 
4011 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition___init__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4012  int __pyx_r;
4013  __Pyx_RefNannyDeclarations
4014  __Pyx_RefNannySetupContext("__init__", 0);
4015 
4016  /* "BoundaryConditions.py":68
4017  * """
4018  * def __init__(self):
4019  * self.uOfXT = None # <<<<<<<<<<<<<<
4020  *
4021  * def init_cython(self):
4022  */
4023  __Pyx_INCREF(Py_None);
4024  __Pyx_GIVEREF(Py_None);
4025  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4026  __Pyx_DECREF(__pyx_v_self->uOfXT);
4027  __pyx_v_self->uOfXT = Py_None;
4028 
4029  /* "BoundaryConditions.py":67
4030  * no boundary condition
4031  * """
4032  * def __init__(self): # <<<<<<<<<<<<<<
4033  * self.uOfXT = None
4034  *
4035  */
4036 
4037  /* function exit code */
4038  __pyx_r = 0;
4039  __Pyx_RefNannyFinishContext();
4040  return __pyx_r;
4041 }
4042 
4043 /* "BoundaryConditions.py":70
4044  * self.uOfXT = None
4045  *
4046  * def init_cython(self): # <<<<<<<<<<<<<<
4047  * return self.uOfXT
4048  *
4049  */
4050 
4051 /* Python wrapper */
4052 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4053 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython = {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, 0};
4054 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4055  PyObject *__pyx_r = 0;
4056  __Pyx_RefNannyDeclarations
4057  __Pyx_RefNannySetupContext("init_cython (wrapper)", 0);
4058  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4059 
4060  /* function exit code */
4061  __Pyx_RefNannyFinishContext();
4062  return __pyx_r;
4063 }
4064 
4065 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_2init_cython(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4066  PyObject *__pyx_r = NULL;
4067  __Pyx_RefNannyDeclarations
4068  __Pyx_RefNannySetupContext("init_cython", 0);
4069 
4070  /* "BoundaryConditions.py":71
4071  *
4072  * def init_cython(self):
4073  * return self.uOfXT # <<<<<<<<<<<<<<
4074  *
4075  * def resetBC(self):
4076  */
4077  __Pyx_XDECREF(__pyx_r);
4078  __Pyx_INCREF(__pyx_v_self->uOfXT);
4079  __pyx_r = __pyx_v_self->uOfXT;
4080  goto __pyx_L0;
4081 
4082  /* "BoundaryConditions.py":70
4083  * self.uOfXT = None
4084  *
4085  * def init_cython(self): # <<<<<<<<<<<<<<
4086  * return self.uOfXT
4087  *
4088  */
4089 
4090  /* function exit code */
4091  __pyx_L0:;
4092  __Pyx_XGIVEREF(__pyx_r);
4093  __Pyx_RefNannyFinishContext();
4094  return __pyx_r;
4095 }
4096 
4097 /* "BoundaryConditions.py":73
4098  * return self.uOfXT
4099  *
4100  * def resetBC(self): # <<<<<<<<<<<<<<
4101  * self.uOfXT = None
4102  *
4103  */
4104 
4105 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4106 static void __pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, int __pyx_skip_dispatch) {
4107  __Pyx_RefNannyDeclarations
4108  PyObject *__pyx_t_1 = NULL;
4109  PyObject *__pyx_t_2 = NULL;
4110  PyObject *__pyx_t_3 = NULL;
4111  PyObject *__pyx_t_4 = NULL;
4112  __Pyx_RefNannySetupContext("resetBC", 0);
4113  /* Check if called by wrapper */
4114  if (unlikely(__pyx_skip_dispatch)) ;
4115  /* Check if overridden in Python */
4116  else if (unlikely(Py_TYPE(((PyObject *)__pyx_v_self))->tp_dictoffset != 0)) {
4117  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_resetBC); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
4118  __Pyx_GOTREF(__pyx_t_1);
4119  if (!PyCFunction_Check(__pyx_t_1) || (PyCFunction_GET_FUNCTION(__pyx_t_1) != (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC)) {
4120  __Pyx_INCREF(__pyx_t_1);
4121  __pyx_t_3 = __pyx_t_1; __pyx_t_4 = NULL;
4122  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
4123  __pyx_t_4 = PyMethod_GET_SELF(__pyx_t_3);
4124  if (likely(__pyx_t_4)) {
4125  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
4126  __Pyx_INCREF(__pyx_t_4);
4127  __Pyx_INCREF(function);
4128  __Pyx_DECREF_SET(__pyx_t_3, function);
4129  }
4130  }
4131  if (__pyx_t_4) {
4132  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
4133  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
4134  } else {
4135  __pyx_t_2 = __Pyx_PyObject_CallNoArg(__pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 73, __pyx_L1_error)
4136  }
4137  __Pyx_GOTREF(__pyx_t_2);
4138  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4139  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4140  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4141  goto __pyx_L0;
4142  }
4143  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4144  }
4145 
4146  /* "BoundaryConditions.py":74
4147  *
4148  * def resetBC(self):
4149  * self.uOfXT = None # <<<<<<<<<<<<<<
4150  *
4151  * def setConstantBC(self, value):
4152  */
4153  __Pyx_INCREF(Py_None);
4154  __Pyx_GIVEREF(Py_None);
4155  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4156  __Pyx_DECREF(__pyx_v_self->uOfXT);
4157  __pyx_v_self->uOfXT = Py_None;
4158 
4159  /* "BoundaryConditions.py":73
4160  * return self.uOfXT
4161  *
4162  * def resetBC(self): # <<<<<<<<<<<<<<
4163  * self.uOfXT = None
4164  *
4165  */
4166 
4167  /* function exit code */
4168  goto __pyx_L0;
4169  __pyx_L1_error:;
4170  __Pyx_XDECREF(__pyx_t_1);
4171  __Pyx_XDECREF(__pyx_t_2);
4172  __Pyx_XDECREF(__pyx_t_3);
4173  __Pyx_XDECREF(__pyx_t_4);
4174  __Pyx_WriteUnraisable("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
4175  __pyx_L0:;
4176  __Pyx_RefNannyFinishContext();
4177 }
4178 
4179 /* Python wrapper */
4180 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4181 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC = {"resetBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC, METH_NOARGS, 0};
4182 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5resetBC(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4183  PyObject *__pyx_r = 0;
4184  __Pyx_RefNannyDeclarations
4185  __Pyx_RefNannySetupContext("resetBC (wrapper)", 0);
4186  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4187 
4188  /* function exit code */
4189  __Pyx_RefNannyFinishContext();
4190  return __pyx_r;
4191 }
4192 
4193 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_4resetBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4194  PyObject *__pyx_r = NULL;
4195  __Pyx_RefNannyDeclarations
4196  PyObject *__pyx_t_1 = NULL;
4197  __Pyx_RefNannySetupContext("resetBC", 0);
4198  __Pyx_XDECREF(__pyx_r);
4199  __pyx_t_1 = __Pyx_void_to_None(__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC(__pyx_v_self, 1)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
4200  __Pyx_GOTREF(__pyx_t_1);
4201  __pyx_r = __pyx_t_1;
4202  __pyx_t_1 = 0;
4203  goto __pyx_L0;
4204 
4205  /* function exit code */
4206  __pyx_L1_error:;
4207  __Pyx_XDECREF(__pyx_t_1);
4208  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.resetBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4209  __pyx_r = NULL;
4210  __pyx_L0:;
4211  __Pyx_XGIVEREF(__pyx_r);
4212  __Pyx_RefNannyFinishContext();
4213  return __pyx_r;
4214 }
4215 
4216 /* "BoundaryConditions.py":76
4217  * self.uOfXT = None
4218  *
4219  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4220  * """
4221  * function returning constant BC
4222  */
4223 
4224 /* Python wrapper */
4225 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4226 static char __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC[] = "\n function returning constant BC\n\n Parameters\n ----------\n value :\n\n ";
4227 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC = {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC};
4228 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4229  PyObject *__pyx_r = 0;
4230  __Pyx_RefNannyDeclarations
4231  __Pyx_RefNannySetupContext("setConstantBC (wrapper)", 0);
4232  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4233 
4234  /* function exit code */
4235  __Pyx_RefNannyFinishContext();
4236  return __pyx_r;
4237 }
4238 
4239 /* "BoundaryConditions.py":85
4240  *
4241  * """
4242  * self.uOfXT = lambda x, t: value # <<<<<<<<<<<<<<
4243  *
4244  *
4245  */
4246 
4247 /* Python wrapper */
4248 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4249 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda = {"lambda", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, METH_VARARGS|METH_KEYWORDS, 0};
4250 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4251  CYTHON_UNUSED PyObject *__pyx_v_x = 0;
4252  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4253  PyObject *__pyx_r = 0;
4254  __Pyx_RefNannyDeclarations
4255  __Pyx_RefNannySetupContext("lambda (wrapper)", 0);
4256  {
4257  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4258  PyObject* values[2] = {0,0};
4259  if (unlikely(__pyx_kwds)) {
4260  Py_ssize_t kw_args;
4261  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4262  switch (pos_args) {
4263  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4264  CYTHON_FALLTHROUGH;
4265  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4266  CYTHON_FALLTHROUGH;
4267  case 0: break;
4268  default: goto __pyx_L5_argtuple_error;
4269  }
4270  kw_args = PyDict_Size(__pyx_kwds);
4271  switch (pos_args) {
4272  case 0:
4273  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4274  else goto __pyx_L5_argtuple_error;
4275  CYTHON_FALLTHROUGH;
4276  case 1:
4277  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4278  else {
4279  __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, 1); __PYX_ERR(1, 85, __pyx_L3_error)
4280  }
4281  }
4282  if (unlikely(kw_args > 0)) {
4283  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda") < 0)) __PYX_ERR(1, 85, __pyx_L3_error)
4284  }
4285  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4286  goto __pyx_L5_argtuple_error;
4287  } else {
4288  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4289  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4290  }
4291  __pyx_v_x = values[0];
4292  __pyx_v_t = values[1];
4293  }
4294  goto __pyx_L4_argument_unpacking_done;
4295  __pyx_L5_argtuple_error:;
4296  __Pyx_RaiseArgtupleInvalid("lambda", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 85, __pyx_L3_error)
4297  __pyx_L3_error:;
4298  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4299  __Pyx_RefNannyFinishContext();
4300  return NULL;
4301  __pyx_L4_argument_unpacking_done:;
4302  __pyx_r = __pyx_lambda_funcdef_lambda(__pyx_self, __pyx_v_x, __pyx_v_t);
4303 
4304  /* function exit code */
4305  __Pyx_RefNannyFinishContext();
4306  return __pyx_r;
4307 }
4308 
4309 static PyObject *__pyx_lambda_funcdef_lambda(PyObject *__pyx_self, CYTHON_UNUSED PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
4310  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4311  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_outer_scope;
4312  PyObject *__pyx_r = NULL;
4313  __Pyx_RefNannyDeclarations
4314  __Pyx_RefNannySetupContext("lambda", 0);
4315  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4316  __pyx_cur_scope = __pyx_outer_scope;
4317  __Pyx_XDECREF(__pyx_r);
4318  if (unlikely(!__pyx_cur_scope->__pyx_v_value)) { __Pyx_RaiseClosureNameError("value"); __PYX_ERR(1, 85, __pyx_L1_error) }
4319  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4320  __pyx_r = __pyx_cur_scope->__pyx_v_value;
4321  goto __pyx_L0;
4322 
4323  /* function exit code */
4324  __pyx_L1_error:;
4325  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC.lambda", __pyx_clineno, __pyx_lineno, __pyx_filename);
4326  __pyx_r = NULL;
4327  __pyx_L0:;
4328  __Pyx_XGIVEREF(__pyx_r);
4329  __Pyx_RefNannyFinishContext();
4330  return __pyx_r;
4331 }
4332 
4333 /* "BoundaryConditions.py":76
4334  * self.uOfXT = None
4335  *
4336  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4337  * """
4338  * function returning constant BC
4339  */
4340 
4341 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_6setConstantBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4342  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_cur_scope;
4343  PyObject *__pyx_r = NULL;
4344  __Pyx_RefNannyDeclarations
4345  PyObject *__pyx_t_1 = NULL;
4346  __Pyx_RefNannySetupContext("setConstantBC", 0);
4347  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC, __pyx_empty_tuple, NULL);
4348  if (unlikely(!__pyx_cur_scope)) {
4349  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)Py_None);
4350  __Pyx_INCREF(Py_None);
4351  __PYX_ERR(1, 76, __pyx_L1_error)
4352  } else {
4353  __Pyx_GOTREF(__pyx_cur_scope);
4354  }
4355  __pyx_cur_scope->__pyx_v_value = __pyx_v_value;
4356  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_value);
4357  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_value);
4358 
4359  /* "BoundaryConditions.py":85
4360  *
4361  * """
4362  * self.uOfXT = lambda x, t: value # <<<<<<<<<<<<<<
4363  *
4364  *
4365  */
4366  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13setConstantBC_lambda, 0, __pyx_n_s_setConstantBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 85, __pyx_L1_error)
4367  __Pyx_GOTREF(__pyx_t_1);
4368  __Pyx_GIVEREF(__pyx_t_1);
4369  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4370  __Pyx_DECREF(__pyx_v_self->uOfXT);
4371  __pyx_v_self->uOfXT = __pyx_t_1;
4372  __pyx_t_1 = 0;
4373 
4374  /* "BoundaryConditions.py":76
4375  * self.uOfXT = None
4376  *
4377  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
4378  * """
4379  * function returning constant BC
4380  */
4381 
4382  /* function exit code */
4383  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4384  goto __pyx_L0;
4385  __pyx_L1_error:;
4386  __Pyx_XDECREF(__pyx_t_1);
4387  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setConstantBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4388  __pyx_r = NULL;
4389  __pyx_L0:;
4390  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4391  __Pyx_XGIVEREF(__pyx_r);
4392  __Pyx_RefNannyFinishContext();
4393  return __pyx_r;
4394 }
4395 
4396 /* "BoundaryConditions.py":88
4397  *
4398  *
4399  * def setLinearBC(self, a0, a1, i): # <<<<<<<<<<<<<<
4400  * self.uOfXT = lambda x, t: a0+a1*x[i]
4401  */
4402 
4403 /* Python wrapper */
4404 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4405 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC = {"setLinearBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, 0};
4406 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4407  PyObject *__pyx_v_a0 = 0;
4408  PyObject *__pyx_v_a1 = 0;
4409  PyObject *__pyx_v_i = 0;
4410  PyObject *__pyx_r = 0;
4411  __Pyx_RefNannyDeclarations
4412  __Pyx_RefNannySetupContext("setLinearBC (wrapper)", 0);
4413  {
4414  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_a0,&__pyx_n_s_a1,&__pyx_n_s_i,0};
4415  PyObject* values[3] = {0,0,0};
4416  if (unlikely(__pyx_kwds)) {
4417  Py_ssize_t kw_args;
4418  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4419  switch (pos_args) {
4420  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4421  CYTHON_FALLTHROUGH;
4422  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4423  CYTHON_FALLTHROUGH;
4424  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4425  CYTHON_FALLTHROUGH;
4426  case 0: break;
4427  default: goto __pyx_L5_argtuple_error;
4428  }
4429  kw_args = PyDict_Size(__pyx_kwds);
4430  switch (pos_args) {
4431  case 0:
4432  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a0)) != 0)) kw_args--;
4433  else goto __pyx_L5_argtuple_error;
4434  CYTHON_FALLTHROUGH;
4435  case 1:
4436  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_a1)) != 0)) kw_args--;
4437  else {
4438  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 3, 3, 1); __PYX_ERR(1, 88, __pyx_L3_error)
4439  }
4440  CYTHON_FALLTHROUGH;
4441  case 2:
4442  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_i)) != 0)) kw_args--;
4443  else {
4444  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 3, 3, 2); __PYX_ERR(1, 88, __pyx_L3_error)
4445  }
4446  }
4447  if (unlikely(kw_args > 0)) {
4448  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "setLinearBC") < 0)) __PYX_ERR(1, 88, __pyx_L3_error)
4449  }
4450  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4451  goto __pyx_L5_argtuple_error;
4452  } else {
4453  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4454  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4455  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4456  }
4457  __pyx_v_a0 = values[0];
4458  __pyx_v_a1 = values[1];
4459  __pyx_v_i = values[2];
4460  }
4461  goto __pyx_L4_argument_unpacking_done;
4462  __pyx_L5_argtuple_error:;
4463  __Pyx_RaiseArgtupleInvalid("setLinearBC", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 88, __pyx_L3_error)
4464  __pyx_L3_error:;
4465  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4466  __Pyx_RefNannyFinishContext();
4467  return NULL;
4468  __pyx_L4_argument_unpacking_done:;
4469  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), __pyx_v_a0, __pyx_v_a1, __pyx_v_i);
4470 
4471  /* function exit code */
4472  __Pyx_RefNannyFinishContext();
4473  return __pyx_r;
4474 }
4475 
4476 /* "BoundaryConditions.py":89
4477  *
4478  * def setLinearBC(self, a0, a1, i):
4479  * self.uOfXT = lambda x, t: a0+a1*x[i] # <<<<<<<<<<<<<<
4480  */
4481 
4482 /* Python wrapper */
4483 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4484 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1 = {"lambda1", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, METH_VARARGS|METH_KEYWORDS, 0};
4485 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4486  PyObject *__pyx_v_x = 0;
4487  CYTHON_UNUSED PyObject *__pyx_v_t = 0;
4488  PyObject *__pyx_r = 0;
4489  __Pyx_RefNannyDeclarations
4490  __Pyx_RefNannySetupContext("lambda1 (wrapper)", 0);
4491  {
4492  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_x,&__pyx_n_s_t,0};
4493  PyObject* values[2] = {0,0};
4494  if (unlikely(__pyx_kwds)) {
4495  Py_ssize_t kw_args;
4496  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4497  switch (pos_args) {
4498  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4499  CYTHON_FALLTHROUGH;
4500  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4501  CYTHON_FALLTHROUGH;
4502  case 0: break;
4503  default: goto __pyx_L5_argtuple_error;
4504  }
4505  kw_args = PyDict_Size(__pyx_kwds);
4506  switch (pos_args) {
4507  case 0:
4508  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_x)) != 0)) kw_args--;
4509  else goto __pyx_L5_argtuple_error;
4510  CYTHON_FALLTHROUGH;
4511  case 1:
4512  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_t)) != 0)) kw_args--;
4513  else {
4514  __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, 1); __PYX_ERR(1, 89, __pyx_L3_error)
4515  }
4516  }
4517  if (unlikely(kw_args > 0)) {
4518  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "lambda1") < 0)) __PYX_ERR(1, 89, __pyx_L3_error)
4519  }
4520  } else if (PyTuple_GET_SIZE(__pyx_args) != 2) {
4521  goto __pyx_L5_argtuple_error;
4522  } else {
4523  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4524  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4525  }
4526  __pyx_v_x = values[0];
4527  __pyx_v_t = values[1];
4528  }
4529  goto __pyx_L4_argument_unpacking_done;
4530  __pyx_L5_argtuple_error:;
4531  __Pyx_RaiseArgtupleInvalid("lambda1", 1, 2, 2, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(1, 89, __pyx_L3_error)
4532  __pyx_L3_error:;
4533  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4534  __Pyx_RefNannyFinishContext();
4535  return NULL;
4536  __pyx_L4_argument_unpacking_done:;
4537  __pyx_r = __pyx_lambda_funcdef_lambda1(__pyx_self, __pyx_v_x, __pyx_v_t);
4538 
4539  /* function exit code */
4540  __Pyx_RefNannyFinishContext();
4541  return __pyx_r;
4542 }
4543 
4544 static PyObject *__pyx_lambda_funcdef_lambda1(PyObject *__pyx_self, PyObject *__pyx_v_x, CYTHON_UNUSED PyObject *__pyx_v_t) {
4545  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
4546  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_outer_scope;
4547  PyObject *__pyx_r = NULL;
4548  __Pyx_RefNannyDeclarations
4549  PyObject *__pyx_t_1 = NULL;
4550  PyObject *__pyx_t_2 = NULL;
4551  __Pyx_RefNannySetupContext("lambda1", 0);
4552  __pyx_outer_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *) __Pyx_CyFunction_GetClosure(__pyx_self);
4553  __pyx_cur_scope = __pyx_outer_scope;
4554  __Pyx_XDECREF(__pyx_r);
4555  if (unlikely(!__pyx_cur_scope->__pyx_v_a0)) { __Pyx_RaiseClosureNameError("a0"); __PYX_ERR(1, 89, __pyx_L1_error) }
4556  if (unlikely(!__pyx_cur_scope->__pyx_v_a1)) { __Pyx_RaiseClosureNameError("a1"); __PYX_ERR(1, 89, __pyx_L1_error) }
4557  if (unlikely(!__pyx_cur_scope->__pyx_v_i)) { __Pyx_RaiseClosureNameError("i"); __PYX_ERR(1, 89, __pyx_L1_error) }
4558  __pyx_t_1 = __Pyx_PyObject_GetItem(__pyx_v_x, __pyx_cur_scope->__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
4559  __Pyx_GOTREF(__pyx_t_1);
4560  __pyx_t_2 = PyNumber_Multiply(__pyx_cur_scope->__pyx_v_a1, __pyx_t_1); if (unlikely(!__pyx_t_2)) __PYX_ERR(1, 89, __pyx_L1_error)
4561  __Pyx_GOTREF(__pyx_t_2);
4562  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4563  __pyx_t_1 = PyNumber_Add(__pyx_cur_scope->__pyx_v_a0, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
4564  __Pyx_GOTREF(__pyx_t_1);
4565  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4566  __pyx_r = __pyx_t_1;
4567  __pyx_t_1 = 0;
4568  goto __pyx_L0;
4569 
4570  /* function exit code */
4571  __pyx_L1_error:;
4572  __Pyx_XDECREF(__pyx_t_1);
4573  __Pyx_XDECREF(__pyx_t_2);
4574  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC.lambda1", __pyx_clineno, __pyx_lineno, __pyx_filename);
4575  __pyx_r = NULL;
4576  __pyx_L0:;
4577  __Pyx_XGIVEREF(__pyx_r);
4578  __Pyx_RefNannyFinishContext();
4579  return __pyx_r;
4580 }
4581 
4582 /* "BoundaryConditions.py":88
4583  *
4584  *
4585  * def setLinearBC(self, a0, a1, i): # <<<<<<<<<<<<<<
4586  * self.uOfXT = lambda x, t: a0+a1*x[i]
4587  */
4588 
4589 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_8setLinearBC(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_a0, PyObject *__pyx_v_a1, PyObject *__pyx_v_i) {
4590  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_cur_scope;
4591  PyObject *__pyx_r = NULL;
4592  __Pyx_RefNannyDeclarations
4593  PyObject *__pyx_t_1 = NULL;
4594  __Pyx_RefNannySetupContext("setLinearBC", 0);
4595  __pyx_cur_scope = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(__pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, __pyx_empty_tuple, NULL);
4596  if (unlikely(!__pyx_cur_scope)) {
4597  __pyx_cur_scope = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)Py_None);
4598  __Pyx_INCREF(Py_None);
4599  __PYX_ERR(1, 88, __pyx_L1_error)
4600  } else {
4601  __Pyx_GOTREF(__pyx_cur_scope);
4602  }
4603  __pyx_cur_scope->__pyx_v_a0 = __pyx_v_a0;
4604  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a0);
4605  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a0);
4606  __pyx_cur_scope->__pyx_v_a1 = __pyx_v_a1;
4607  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_a1);
4608  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_a1);
4609  __pyx_cur_scope->__pyx_v_i = __pyx_v_i;
4610  __Pyx_INCREF(__pyx_cur_scope->__pyx_v_i);
4611  __Pyx_GIVEREF(__pyx_cur_scope->__pyx_v_i);
4612 
4613  /* "BoundaryConditions.py":89
4614  *
4615  * def setLinearBC(self, a0, a1, i):
4616  * self.uOfXT = lambda x, t: a0+a1*x[i] # <<<<<<<<<<<<<<
4617  */
4618  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11setLinearBC_lambda1, 0, __pyx_n_s_setLinearBC_locals_lambda, ((PyObject*)__pyx_cur_scope), __pyx_n_s_BoundaryConditions, __pyx_d, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 89, __pyx_L1_error)
4619  __Pyx_GOTREF(__pyx_t_1);
4620  __Pyx_GIVEREF(__pyx_t_1);
4621  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4622  __Pyx_DECREF(__pyx_v_self->uOfXT);
4623  __pyx_v_self->uOfXT = __pyx_t_1;
4624  __pyx_t_1 = 0;
4625 
4626  /* "BoundaryConditions.py":88
4627  *
4628  *
4629  * def setLinearBC(self, a0, a1, i): # <<<<<<<<<<<<<<
4630  * self.uOfXT = lambda x, t: a0+a1*x[i]
4631  */
4632 
4633  /* function exit code */
4634  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
4635  goto __pyx_L0;
4636  __pyx_L1_error:;
4637  __Pyx_XDECREF(__pyx_t_1);
4638  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.setLinearBC", __pyx_clineno, __pyx_lineno, __pyx_filename);
4639  __pyx_r = NULL;
4640  __pyx_L0:;
4641  __Pyx_DECREF(((PyObject *)__pyx_cur_scope));
4642  __Pyx_XGIVEREF(__pyx_r);
4643  __Pyx_RefNannyFinishContext();
4644  return __pyx_r;
4645 }
4646 
4647 /* "BoundaryConditions.pxd":20
4648  * cdef cpp_uOfXT uuOfXT
4649  * cdef public:
4650  * object uOfXT # <<<<<<<<<<<<<<
4651  * cpdef void resetBC(self)
4652  * # cpdef void setConstantBC(self, double value)
4653  */
4654 
4655 /* Python wrapper */
4656 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self); /*proto*/
4657 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(PyObject *__pyx_v_self) {
4658  PyObject *__pyx_r = 0;
4659  __Pyx_RefNannyDeclarations
4660  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
4661  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4662 
4663  /* function exit code */
4664  __Pyx_RefNannyFinishContext();
4665  return __pyx_r;
4666 }
4667 
4668 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT___get__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4669  PyObject *__pyx_r = NULL;
4670  __Pyx_RefNannyDeclarations
4671  __Pyx_RefNannySetupContext("__get__", 0);
4672  __Pyx_XDECREF(__pyx_r);
4673  __Pyx_INCREF(__pyx_v_self->uOfXT);
4674  __pyx_r = __pyx_v_self->uOfXT;
4675  goto __pyx_L0;
4676 
4677  /* function exit code */
4678  __pyx_L0:;
4679  __Pyx_XGIVEREF(__pyx_r);
4680  __Pyx_RefNannyFinishContext();
4681  return __pyx_r;
4682 }
4683 
4684 /* Python wrapper */
4685 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value); /*proto*/
4686 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(PyObject *__pyx_v_self, PyObject *__pyx_v_value) {
4687  int __pyx_r;
4688  __Pyx_RefNannyDeclarations
4689  __Pyx_RefNannySetupContext("__set__ (wrapper)", 0);
4690  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v_value));
4691 
4692  /* function exit code */
4693  __Pyx_RefNannyFinishContext();
4694  return __pyx_r;
4695 }
4696 
4697 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_2__set__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, PyObject *__pyx_v_value) {
4698  int __pyx_r;
4699  __Pyx_RefNannyDeclarations
4700  __Pyx_RefNannySetupContext("__set__", 0);
4701  __Pyx_INCREF(__pyx_v_value);
4702  __Pyx_GIVEREF(__pyx_v_value);
4703  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4704  __Pyx_DECREF(__pyx_v_self->uOfXT);
4705  __pyx_v_self->uOfXT = __pyx_v_value;
4706 
4707  /* function exit code */
4708  __pyx_r = 0;
4709  __Pyx_RefNannyFinishContext();
4710  return __pyx_r;
4711 }
4712 
4713 /* Python wrapper */
4714 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self); /*proto*/
4715 static int __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(PyObject *__pyx_v_self) {
4716  int __pyx_r;
4717  __Pyx_RefNannyDeclarations
4718  __Pyx_RefNannySetupContext("__del__ (wrapper)", 0);
4719  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4720 
4721  /* function exit code */
4722  __Pyx_RefNannyFinishContext();
4723  return __pyx_r;
4724 }
4725 
4726 static int __pyx_pf_18BoundaryConditions_17BoundaryCondition_5uOfXT_4__del__(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4727  int __pyx_r;
4728  __Pyx_RefNannyDeclarations
4729  __Pyx_RefNannySetupContext("__del__", 0);
4730  __Pyx_INCREF(Py_None);
4731  __Pyx_GIVEREF(Py_None);
4732  __Pyx_GOTREF(__pyx_v_self->uOfXT);
4733  __Pyx_DECREF(__pyx_v_self->uOfXT);
4734  __pyx_v_self->uOfXT = Py_None;
4735 
4736  /* function exit code */
4737  __pyx_r = 0;
4738  __Pyx_RefNannyFinishContext();
4739  return __pyx_r;
4740 }
4741 
4742 /* "(tree fragment)":1
4743  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4744  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
4745  * def __setstate_cython__(self, __pyx_state):
4746  */
4747 
4748 /* Python wrapper */
4749 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
4750 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__, METH_NOARGS, 0};
4751 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
4752  PyObject *__pyx_r = 0;
4753  __Pyx_RefNannyDeclarations
4754  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
4755  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_10__reduce_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self));
4756 
4757  /* function exit code */
4758  __Pyx_RefNannyFinishContext();
4759  return __pyx_r;
4760 }
4761 
4762 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_10__reduce_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self) {
4763  PyObject *__pyx_r = NULL;
4764  __Pyx_RefNannyDeclarations
4765  PyObject *__pyx_t_1 = NULL;
4766  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
4767 
4768  /* "(tree fragment)":2
4769  * def __reduce_cython__(self):
4770  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
4771  * def __setstate_cython__(self, __pyx_state):
4772  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
4773  */
4774  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple_, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
4775  __Pyx_GOTREF(__pyx_t_1);
4776  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4777  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4778  __PYX_ERR(0, 2, __pyx_L1_error)
4779 
4780  /* "(tree fragment)":1
4781  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
4782  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
4783  * def __setstate_cython__(self, __pyx_state):
4784  */
4785 
4786  /* function exit code */
4787  __pyx_L1_error:;
4788  __Pyx_XDECREF(__pyx_t_1);
4789  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4790  __pyx_r = NULL;
4791  __Pyx_XGIVEREF(__pyx_r);
4792  __Pyx_RefNannyFinishContext();
4793  return __pyx_r;
4794 }
4795 
4796 /* "(tree fragment)":3
4797  * def __reduce_cython__(self):
4798  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
4799  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4800  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
4801  */
4802 
4803 /* Python wrapper */
4804 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
4805 static PyMethodDef __pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__, METH_O, 0};
4806 static PyObject *__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
4807  PyObject *__pyx_r = 0;
4808  __Pyx_RefNannyDeclarations
4809  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
4810  __pyx_r = __pyx_pf_18BoundaryConditions_17BoundaryCondition_12__setstate_cython__(((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
4811 
4812  /* function exit code */
4813  __Pyx_RefNannyFinishContext();
4814  return __pyx_r;
4815 }
4816 
4817 static PyObject *__pyx_pf_18BoundaryConditions_17BoundaryCondition_12__setstate_cython__(CYTHON_UNUSED struct __pyx_obj_18BoundaryConditions_BoundaryCondition *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
4818  PyObject *__pyx_r = NULL;
4819  __Pyx_RefNannyDeclarations
4820  PyObject *__pyx_t_1 = NULL;
4821  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
4822 
4823  /* "(tree fragment)":4
4824  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
4825  * def __setstate_cython__(self, __pyx_state):
4826  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
4827  */
4828  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__2, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
4829  __Pyx_GOTREF(__pyx_t_1);
4830  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
4831  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
4832  __PYX_ERR(0, 4, __pyx_L1_error)
4833 
4834  /* "(tree fragment)":3
4835  * def __reduce_cython__(self):
4836  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
4837  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
4838  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
4839  */
4840 
4841  /* function exit code */
4842  __pyx_L1_error:;
4843  __Pyx_XDECREF(__pyx_t_1);
4844  __Pyx_AddTraceback("BoundaryConditions.BoundaryCondition.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
4845  __pyx_r = NULL;
4846  __Pyx_XGIVEREF(__pyx_r);
4847  __Pyx_RefNannyFinishContext();
4848  return __pyx_r;
4849 }
4850 
4851 /* "(tree fragment)":1
4852  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
4853  * if __pyx_checksum != 0x96e6a1f:
4854  * from pickle import PickleError as __pyx_PickleError
4855  */
4856 
4857 /* Python wrapper */
4858 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
4859 static PyMethodDef __pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base = {"__pyx_unpickle_BC_Base", (PyCFunction)__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base, METH_VARARGS|METH_KEYWORDS, 0};
4860 static PyObject *__pyx_pw_18BoundaryConditions_1__pyx_unpickle_BC_Base(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
4861  PyObject *__pyx_v___pyx_type = 0;
4862  long __pyx_v___pyx_checksum;
4863  PyObject *__pyx_v___pyx_state = 0;
4864  PyObject *__pyx_r = 0;
4865  __Pyx_RefNannyDeclarations
4866  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base (wrapper)", 0);
4867  {
4868  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
4869  PyObject* values[3] = {0,0,0};
4870  if (unlikely(__pyx_kwds)) {
4871  Py_ssize_t kw_args;
4872  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
4873  switch (pos_args) {
4874  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4875  CYTHON_FALLTHROUGH;
4876  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4877  CYTHON_FALLTHROUGH;
4878  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4879  CYTHON_FALLTHROUGH;
4880  case 0: break;
4881  default: goto __pyx_L5_argtuple_error;
4882  }
4883  kw_args = PyDict_Size(__pyx_kwds);
4884  switch (pos_args) {
4885  case 0:
4886  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
4887  else goto __pyx_L5_argtuple_error;
4888  CYTHON_FALLTHROUGH;
4889  case 1:
4890  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
4891  else {
4892  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
4893  }
4894  CYTHON_FALLTHROUGH;
4895  case 2:
4896  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
4897  else {
4898  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
4899  }
4900  }
4901  if (unlikely(kw_args > 0)) {
4902  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_BC_Base") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
4903  }
4904  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
4905  goto __pyx_L5_argtuple_error;
4906  } else {
4907  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
4908  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
4909  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
4910  }
4911  __pyx_v___pyx_type = values[0];
4912  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
4913  __pyx_v___pyx_state = values[2];
4914  }
4915  goto __pyx_L4_argument_unpacking_done;
4916  __pyx_L5_argtuple_error:;
4917  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_BC_Base", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
4918  __pyx_L3_error:;
4919  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
4920  __Pyx_RefNannyFinishContext();
4921  return NULL;
4922  __pyx_L4_argument_unpacking_done:;
4923  __pyx_r = __pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
4924 
4925  /* function exit code */
4926  __Pyx_RefNannyFinishContext();
4927  return __pyx_r;
4928 }
4929 
4930 static PyObject *__pyx_pf_18BoundaryConditions___pyx_unpickle_BC_Base(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
4931  PyObject *__pyx_v___pyx_PickleError = NULL;
4932  PyObject *__pyx_v___pyx_result = NULL;
4933  PyObject *__pyx_r = NULL;
4934  __Pyx_RefNannyDeclarations
4935  int __pyx_t_1;
4936  PyObject *__pyx_t_2 = NULL;
4937  PyObject *__pyx_t_3 = NULL;
4938  PyObject *__pyx_t_4 = NULL;
4939  PyObject *__pyx_t_5 = NULL;
4940  PyObject *__pyx_t_6 = NULL;
4941  int __pyx_t_7;
4942  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base", 0);
4943 
4944  /* "(tree fragment)":2
4945  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state):
4946  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
4947  * from pickle import PickleError as __pyx_PickleError
4948  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
4949  */
4950  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0x96e6a1f) != 0);
4951  if (__pyx_t_1) {
4952 
4953  /* "(tree fragment)":3
4954  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state):
4955  * if __pyx_checksum != 0x96e6a1f:
4956  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
4957  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
4958  * __pyx_result = BC_Base.__new__(__pyx_type)
4959  */
4960  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
4961  __Pyx_GOTREF(__pyx_t_2);
4962  __Pyx_INCREF(__pyx_n_s_PickleError);
4963  __Pyx_GIVEREF(__pyx_n_s_PickleError);
4964  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
4965  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, -1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error)
4966  __Pyx_GOTREF(__pyx_t_3);
4967  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4968  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
4969  __Pyx_GOTREF(__pyx_t_2);
4970  __Pyx_INCREF(__pyx_t_2);
4971  __pyx_v___pyx_PickleError = __pyx_t_2;
4972  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4973  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
4974 
4975  /* "(tree fragment)":4
4976  * if __pyx_checksum != 0x96e6a1f:
4977  * from pickle import PickleError as __pyx_PickleError
4978  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum) # <<<<<<<<<<<<<<
4979  * __pyx_result = BC_Base.__new__(__pyx_type)
4980  * if __pyx_state is not None:
4981  */
4982  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
4983  __Pyx_GOTREF(__pyx_t_2);
4984  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error)
4985  __Pyx_GOTREF(__pyx_t_4);
4986  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
4987  __Pyx_INCREF(__pyx_v___pyx_PickleError);
4988  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
4989  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
4990  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
4991  if (likely(__pyx_t_5)) {
4992  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
4993  __Pyx_INCREF(__pyx_t_5);
4994  __Pyx_INCREF(function);
4995  __Pyx_DECREF_SET(__pyx_t_2, function);
4996  }
4997  }
4998  if (!__pyx_t_5) {
4999  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
5000  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5001  __Pyx_GOTREF(__pyx_t_3);
5002  } else {
5003  #if CYTHON_FAST_PYCALL
5004  if (PyFunction_Check(__pyx_t_2)) {
5005  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
5006  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
5007  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5008  __Pyx_GOTREF(__pyx_t_3);
5009  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5010  } else
5011  #endif
5012  #if CYTHON_FAST_PYCCALL
5013  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5014  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
5015  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
5016  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
5017  __Pyx_GOTREF(__pyx_t_3);
5018  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5019  } else
5020  #endif
5021  {
5022  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4, __pyx_L1_error)
5023  __Pyx_GOTREF(__pyx_t_6);
5024  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
5025  __Pyx_GIVEREF(__pyx_t_4);
5026  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
5027  __pyx_t_4 = 0;
5028  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
5029  __Pyx_GOTREF(__pyx_t_3);
5030  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
5031  }
5032  }
5033  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5034  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5035  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5036  __PYX_ERR(0, 4, __pyx_L1_error)
5037 
5038  /* "(tree fragment)":2
5039  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state):
5040  * if __pyx_checksum != 0x96e6a1f: # <<<<<<<<<<<<<<
5041  * from pickle import PickleError as __pyx_PickleError
5042  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5043  */
5044  }
5045 
5046  /* "(tree fragment)":5
5047  * from pickle import PickleError as __pyx_PickleError
5048  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5049  * __pyx_result = BC_Base.__new__(__pyx_type) # <<<<<<<<<<<<<<
5050  * if __pyx_state is not None:
5051  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5052  */
5053  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
5054  __Pyx_GOTREF(__pyx_t_2);
5055  __pyx_t_6 = NULL;
5056  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
5057  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
5058  if (likely(__pyx_t_6)) {
5059  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
5060  __Pyx_INCREF(__pyx_t_6);
5061  __Pyx_INCREF(function);
5062  __Pyx_DECREF_SET(__pyx_t_2, function);
5063  }
5064  }
5065  if (!__pyx_t_6) {
5066  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
5067  __Pyx_GOTREF(__pyx_t_3);
5068  } else {
5069  #if CYTHON_FAST_PYCALL
5070  if (PyFunction_Check(__pyx_t_2)) {
5071  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
5072  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
5073  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5074  __Pyx_GOTREF(__pyx_t_3);
5075  } else
5076  #endif
5077  #if CYTHON_FAST_PYCCALL
5078  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
5079  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
5080  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
5081  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
5082  __Pyx_GOTREF(__pyx_t_3);
5083  } else
5084  #endif
5085  {
5086  __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
5087  __Pyx_GOTREF(__pyx_t_4);
5088  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
5089  __Pyx_INCREF(__pyx_v___pyx_type);
5090  __Pyx_GIVEREF(__pyx_v___pyx_type);
5091  PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
5092  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
5093  __Pyx_GOTREF(__pyx_t_3);
5094  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
5095  }
5096  }
5097  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
5098  __pyx_v___pyx_result = __pyx_t_3;
5099  __pyx_t_3 = 0;
5100 
5101  /* "(tree fragment)":6
5102  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5103  * __pyx_result = BC_Base.__new__(__pyx_type)
5104  * if __pyx_state is not None: # <<<<<<<<<<<<<<
5105  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5106  * return __pyx_result
5107  */
5108  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
5109  __pyx_t_7 = (__pyx_t_1 != 0);
5110  if (__pyx_t_7) {
5111 
5112  /* "(tree fragment)":7
5113  * __pyx_result = BC_Base.__new__(__pyx_type)
5114  * if __pyx_state is not None:
5115  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
5116  * return __pyx_result
5117  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5118  */
5119  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 7, __pyx_L1_error)
5120  __pyx_t_3 = __pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(((struct __pyx_obj_18BoundaryConditions_BC_Base *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
5121  __Pyx_GOTREF(__pyx_t_3);
5122  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5123 
5124  /* "(tree fragment)":6
5125  * raise __pyx_PickleError("Incompatible checksums (%s vs 0x96e6a1f = (BC_type, Shape, _b_or, ct, name, nd))" % __pyx_checksum)
5126  * __pyx_result = BC_Base.__new__(__pyx_type)
5127  * if __pyx_state is not None: # <<<<<<<<<<<<<<
5128  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5129  * return __pyx_result
5130  */
5131  }
5132 
5133  /* "(tree fragment)":8
5134  * if __pyx_state is not None:
5135  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5136  * return __pyx_result # <<<<<<<<<<<<<<
5137  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5138  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5139  */
5140  __Pyx_XDECREF(__pyx_r);
5141  __Pyx_INCREF(__pyx_v___pyx_result);
5142  __pyx_r = __pyx_v___pyx_result;
5143  goto __pyx_L0;
5144 
5145  /* "(tree fragment)":1
5146  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
5147  * if __pyx_checksum != 0x96e6a1f:
5148  * from pickle import PickleError as __pyx_PickleError
5149  */
5150 
5151  /* function exit code */
5152  __pyx_L1_error:;
5153  __Pyx_XDECREF(__pyx_t_2);
5154  __Pyx_XDECREF(__pyx_t_3);
5155  __Pyx_XDECREF(__pyx_t_4);
5156  __Pyx_XDECREF(__pyx_t_5);
5157  __Pyx_XDECREF(__pyx_t_6);
5158  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base", __pyx_clineno, __pyx_lineno, __pyx_filename);
5159  __pyx_r = NULL;
5160  __pyx_L0:;
5161  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
5162  __Pyx_XDECREF(__pyx_v___pyx_result);
5163  __Pyx_XGIVEREF(__pyx_r);
5164  __Pyx_RefNannyFinishContext();
5165  return __pyx_r;
5166 }
5167 
5168 /* "(tree fragment)":9
5169  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5170  * return __pyx_result
5171  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5172  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5173  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
5174  */
5175 
5176 static PyObject *__pyx_f_18BoundaryConditions___pyx_unpickle_BC_Base__set_state(struct __pyx_obj_18BoundaryConditions_BC_Base *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
5177  PyObject *__pyx_r = NULL;
5178  __Pyx_RefNannyDeclarations
5179  PyObject *__pyx_t_1 = NULL;
5180  __Pyx_memviewslice __pyx_t_2 = { 0, 0, { 0 }, { 0 }, { 0 } };
5181  int __pyx_t_3;
5182  int __pyx_t_4;
5183  Py_ssize_t __pyx_t_5;
5184  int __pyx_t_6;
5185  int __pyx_t_7;
5186  PyObject *__pyx_t_8 = NULL;
5187  PyObject *__pyx_t_9 = NULL;
5188  PyObject *__pyx_t_10 = NULL;
5189  PyObject *__pyx_t_11 = NULL;
5190  __Pyx_RefNannySetupContext("__pyx_unpickle_BC_Base__set_state", 0);
5191 
5192  /* "(tree fragment)":10
5193  * return __pyx_result
5194  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5195  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5] # <<<<<<<<<<<<<<
5196  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
5197  * __pyx_result.__dict__.update(__pyx_state[6])
5198  */
5199  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5200  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5201  __PYX_ERR(0, 10, __pyx_L1_error)
5202  }
5203  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5204  __Pyx_GOTREF(__pyx_t_1);
5205  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 10, __pyx_L1_error)
5206  __Pyx_GIVEREF(__pyx_t_1);
5207  __Pyx_GOTREF(__pyx_v___pyx_result->BC_type);
5208  __Pyx_DECREF(__pyx_v___pyx_result->BC_type);
5209  __pyx_v___pyx_result->BC_type = ((PyObject*)__pyx_t_1);
5210  __pyx_t_1 = 0;
5211  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5212  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5213  __PYX_ERR(0, 10, __pyx_L1_error)
5214  }
5215  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5216  __Pyx_GOTREF(__pyx_t_1);
5217  __Pyx_GIVEREF(__pyx_t_1);
5218  __Pyx_GOTREF(__pyx_v___pyx_result->Shape);
5219  __Pyx_DECREF(__pyx_v___pyx_result->Shape);
5220  __pyx_v___pyx_result->Shape = __pyx_t_1;
5221  __pyx_t_1 = 0;
5222  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5223  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5224  __PYX_ERR(0, 10, __pyx_L1_error)
5225  }
5226  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 2, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5227  __Pyx_GOTREF(__pyx_t_1);
5228  __pyx_t_2 = __Pyx_PyObject_to_MemoryviewSlice_ds_double(__pyx_t_1, PyBUF_WRITABLE); if (unlikely(!__pyx_t_2.memview)) __PYX_ERR(0, 10, __pyx_L1_error)
5229  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5230  __PYX_XDEC_MEMVIEW(&__pyx_v___pyx_result->_b_or, 0);
5231  __pyx_v___pyx_result->_b_or = __pyx_t_2;
5232  __pyx_t_2.memview = NULL;
5233  __pyx_t_2.data = NULL;
5234  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5235  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5236  __PYX_ERR(0, 10, __pyx_L1_error)
5237  }
5238  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 3, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5239  __Pyx_GOTREF(__pyx_t_1);
5240  __Pyx_GIVEREF(__pyx_t_1);
5241  __Pyx_GOTREF(__pyx_v___pyx_result->ct);
5242  __Pyx_DECREF(__pyx_v___pyx_result->ct);
5243  __pyx_v___pyx_result->ct = __pyx_t_1;
5244  __pyx_t_1 = 0;
5245  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5246  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5247  __PYX_ERR(0, 10, __pyx_L1_error)
5248  }
5249  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 4, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5250  __Pyx_GOTREF(__pyx_t_1);
5251  if (!(likely(PyString_CheckExact(__pyx_t_1))||((__pyx_t_1) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "str", Py_TYPE(__pyx_t_1)->tp_name), 0))) __PYX_ERR(0, 10, __pyx_L1_error)
5252  __Pyx_GIVEREF(__pyx_t_1);
5253  __Pyx_GOTREF(__pyx_v___pyx_result->name);
5254  __Pyx_DECREF(__pyx_v___pyx_result->name);
5255  __pyx_v___pyx_result->name = ((PyObject*)__pyx_t_1);
5256  __pyx_t_1 = 0;
5257  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5258  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5259  __PYX_ERR(0, 10, __pyx_L1_error)
5260  }
5261  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 5, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
5262  __Pyx_GOTREF(__pyx_t_1);
5263  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 10, __pyx_L1_error)
5264  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5265  __pyx_v___pyx_result->nd = __pyx_t_3;
5266 
5267  /* "(tree fragment)":11
5268  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5269  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5270  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5271  * __pyx_result.__dict__.update(__pyx_state[6])
5272  */
5273  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5274  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
5275  __PYX_ERR(0, 11, __pyx_L1_error)
5276  }
5277  __pyx_t_5 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
5278  __pyx_t_6 = ((__pyx_t_5 > 6) != 0);
5279  if (__pyx_t_6) {
5280  } else {
5281  __pyx_t_4 = __pyx_t_6;
5282  goto __pyx_L4_bool_binop_done;
5283  }
5284  __pyx_t_6 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
5285  __pyx_t_7 = (__pyx_t_6 != 0);
5286  __pyx_t_4 = __pyx_t_7;
5287  __pyx_L4_bool_binop_done:;
5288  if (__pyx_t_4) {
5289 
5290  /* "(tree fragment)":12
5291  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5292  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
5293  * __pyx_result.__dict__.update(__pyx_state[6]) # <<<<<<<<<<<<<<
5294  */
5295  __pyx_t_8 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 12, __pyx_L1_error)
5296  __Pyx_GOTREF(__pyx_t_8);
5297  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_t_8, __pyx_n_s_update); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 12, __pyx_L1_error)
5298  __Pyx_GOTREF(__pyx_t_9);
5299  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5300  if (unlikely(__pyx_v___pyx_state == Py_None)) {
5301  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
5302  __PYX_ERR(0, 12, __pyx_L1_error)
5303  }
5304  __pyx_t_8 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 6, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 12, __pyx_L1_error)
5305  __Pyx_GOTREF(__pyx_t_8);
5306  __pyx_t_10 = NULL;
5307  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_9))) {
5308  __pyx_t_10 = PyMethod_GET_SELF(__pyx_t_9);
5309  if (likely(__pyx_t_10)) {
5310  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_9);
5311  __Pyx_INCREF(__pyx_t_10);
5312  __Pyx_INCREF(function);
5313  __Pyx_DECREF_SET(__pyx_t_9, function);
5314  }
5315  }
5316  if (!__pyx_t_10) {
5317  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_9, __pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
5318  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5319  __Pyx_GOTREF(__pyx_t_1);
5320  } else {
5321  #if CYTHON_FAST_PYCALL
5322  if (PyFunction_Check(__pyx_t_9)) {
5323  PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
5324  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
5325  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5326  __Pyx_GOTREF(__pyx_t_1);
5327  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5328  } else
5329  #endif
5330  #if CYTHON_FAST_PYCCALL
5331  if (__Pyx_PyFastCFunction_Check(__pyx_t_9)) {
5332  PyObject *__pyx_temp[2] = {__pyx_t_10, __pyx_t_8};
5333  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_9, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
5334  __Pyx_XDECREF(__pyx_t_10); __pyx_t_10 = 0;
5335  __Pyx_GOTREF(__pyx_t_1);
5336  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
5337  } else
5338  #endif
5339  {
5340  __pyx_t_11 = PyTuple_New(1+1); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 12, __pyx_L1_error)
5341  __Pyx_GOTREF(__pyx_t_11);
5342  __Pyx_GIVEREF(__pyx_t_10); PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_10); __pyx_t_10 = NULL;
5343  __Pyx_GIVEREF(__pyx_t_8);
5344  PyTuple_SET_ITEM(__pyx_t_11, 0+1, __pyx_t_8);
5345  __pyx_t_8 = 0;
5346  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_9, __pyx_t_11, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
5347  __Pyx_GOTREF(__pyx_t_1);
5348  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
5349  }
5350  }
5351  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
5352  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
5353 
5354  /* "(tree fragment)":11
5355  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state):
5356  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5357  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
5358  * __pyx_result.__dict__.update(__pyx_state[6])
5359  */
5360  }
5361 
5362  /* "(tree fragment)":9
5363  * __pyx_unpickle_BC_Base__set_state(<BC_Base> __pyx_result, __pyx_state)
5364  * return __pyx_result
5365  * cdef __pyx_unpickle_BC_Base__set_state(BC_Base __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
5366  * __pyx_result.BC_type = __pyx_state[0]; __pyx_result.Shape = __pyx_state[1]; __pyx_result._b_or = __pyx_state[2]; __pyx_result.ct = __pyx_state[3]; __pyx_result.name = __pyx_state[4]; __pyx_result.nd = __pyx_state[5]
5367  * if len(__pyx_state) > 6 and hasattr(__pyx_result, '__dict__'):
5368  */
5369 
5370  /* function exit code */
5371  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
5372  goto __pyx_L0;
5373  __pyx_L1_error:;
5374  __Pyx_XDECREF(__pyx_t_1);
5375  __PYX_XDEC_MEMVIEW(&__pyx_t_2, 1);
5376  __Pyx_XDECREF(__pyx_t_8);
5377  __Pyx_XDECREF(__pyx_t_9);
5378  __Pyx_XDECREF(__pyx_t_10);
5379  __Pyx_XDECREF(__pyx_t_11);
5380  __Pyx_AddTraceback("BoundaryConditions.__pyx_unpickle_BC_Base__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
5381  __pyx_r = 0;
5382  __pyx_L0:;
5383  __Pyx_XGIVEREF(__pyx_r);
5384  __Pyx_RefNannyFinishContext();
5385  return __pyx_r;
5386 }
5387 
5388 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
5389  * # experimental exception made for __getbuffer__ and __releasebuffer__
5390  * # -- the details of this may change.
5391  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
5392  * # This implementation of getbuffer is geared towards Cython
5393  * # requirements, and does not yet fulfill the PEP.
5394  */
5395 
5396 /* Python wrapper */
5397 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
5398 static CYTHON_UNUSED int __pyx_pw_5numpy_7ndarray_1__getbuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5399  int __pyx_r;
5400  __Pyx_RefNannyDeclarations
5401  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
5402  __pyx_r = __pyx_pf_5numpy_7ndarray___getbuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
5403 
5404  /* function exit code */
5405  __Pyx_RefNannyFinishContext();
5406  return __pyx_r;
5407 }
5408 
5409 static int __pyx_pf_5numpy_7ndarray___getbuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
5410  int __pyx_v_i;
5411  int __pyx_v_ndim;
5412  int __pyx_v_endian_detector;
5413  int __pyx_v_little_endian;
5414  int __pyx_v_t;
5415  char *__pyx_v_f;
5416  PyArray_Descr *__pyx_v_descr = 0;
5417  int __pyx_v_offset;
5418  int __pyx_r;
5419  __Pyx_RefNannyDeclarations
5420  int __pyx_t_1;
5421  int __pyx_t_2;
5422  PyObject *__pyx_t_3 = NULL;
5423  int __pyx_t_4;
5424  int __pyx_t_5;
5425  int __pyx_t_6;
5426  PyObject *__pyx_t_7 = NULL;
5427  char *__pyx_t_8;
5428  if (__pyx_v_info == NULL) {
5429  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
5430  return -1;
5431  }
5432  __Pyx_RefNannySetupContext("__getbuffer__", 0);
5433  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
5434  __Pyx_GIVEREF(__pyx_v_info->obj);
5435 
5436  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":222
5437  *
5438  * cdef int i, ndim
5439  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
5440  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5441  *
5442  */
5443  __pyx_v_endian_detector = 1;
5444 
5445  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":223
5446  * cdef int i, ndim
5447  * cdef int endian_detector = 1
5448  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
5449  *
5450  * ndim = PyArray_NDIM(self)
5451  */
5452  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
5453 
5454  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":225
5455  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
5456  *
5457  * ndim = PyArray_NDIM(self) # <<<<<<<<<<<<<<
5458  *
5459  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5460  */
5461  __pyx_v_ndim = PyArray_NDIM(__pyx_v_self);
5462 
5463  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
5464  * ndim = PyArray_NDIM(self)
5465  *
5466  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5467  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
5468  * raise ValueError(u"ndarray is not C contiguous")
5469  */
5470  __pyx_t_2 = (((__pyx_v_flags & PyBUF_C_CONTIGUOUS) == PyBUF_C_CONTIGUOUS) != 0);
5471  if (__pyx_t_2) {
5472  } else {
5473  __pyx_t_1 = __pyx_t_2;
5474  goto __pyx_L4_bool_binop_done;
5475  }
5476 
5477  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":228
5478  *
5479  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5480  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)): # <<<<<<<<<<<<<<
5481  * raise ValueError(u"ndarray is not C contiguous")
5482  *
5483  */
5484  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_C_CONTIGUOUS) != 0)) != 0);
5485  __pyx_t_1 = __pyx_t_2;
5486  __pyx_L4_bool_binop_done:;
5487 
5488  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
5489  * ndim = PyArray_NDIM(self)
5490  *
5491  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5492  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
5493  * raise ValueError(u"ndarray is not C contiguous")
5494  */
5495  if (unlikely(__pyx_t_1)) {
5496 
5497  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
5498  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
5499  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
5500  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
5501  *
5502  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5503  */
5504  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__3, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 229, __pyx_L1_error)
5505  __Pyx_GOTREF(__pyx_t_3);
5506  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5507  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5508  __PYX_ERR(3, 229, __pyx_L1_error)
5509 
5510  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":227
5511  * ndim = PyArray_NDIM(self)
5512  *
5513  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS) # <<<<<<<<<<<<<<
5514  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
5515  * raise ValueError(u"ndarray is not C contiguous")
5516  */
5517  }
5518 
5519  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
5520  * raise ValueError(u"ndarray is not C contiguous")
5521  *
5522  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5523  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
5524  * raise ValueError(u"ndarray is not Fortran contiguous")
5525  */
5526  __pyx_t_2 = (((__pyx_v_flags & PyBUF_F_CONTIGUOUS) == PyBUF_F_CONTIGUOUS) != 0);
5527  if (__pyx_t_2) {
5528  } else {
5529  __pyx_t_1 = __pyx_t_2;
5530  goto __pyx_L7_bool_binop_done;
5531  }
5532 
5533  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":232
5534  *
5535  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5536  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)): # <<<<<<<<<<<<<<
5537  * raise ValueError(u"ndarray is not Fortran contiguous")
5538  *
5539  */
5540  __pyx_t_2 = ((!(PyArray_CHKFLAGS(__pyx_v_self, NPY_F_CONTIGUOUS) != 0)) != 0);
5541  __pyx_t_1 = __pyx_t_2;
5542  __pyx_L7_bool_binop_done:;
5543 
5544  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
5545  * raise ValueError(u"ndarray is not C contiguous")
5546  *
5547  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5548  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
5549  * raise ValueError(u"ndarray is not Fortran contiguous")
5550  */
5551  if (unlikely(__pyx_t_1)) {
5552 
5553  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
5554  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
5555  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
5556  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
5557  *
5558  * info.buf = PyArray_DATA(self)
5559  */
5560  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 233, __pyx_L1_error)
5561  __Pyx_GOTREF(__pyx_t_3);
5562  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5563  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5564  __PYX_ERR(3, 233, __pyx_L1_error)
5565 
5566  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":231
5567  * raise ValueError(u"ndarray is not C contiguous")
5568  *
5569  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS) # <<<<<<<<<<<<<<
5570  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
5571  * raise ValueError(u"ndarray is not Fortran contiguous")
5572  */
5573  }
5574 
5575  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":235
5576  * raise ValueError(u"ndarray is not Fortran contiguous")
5577  *
5578  * info.buf = PyArray_DATA(self) # <<<<<<<<<<<<<<
5579  * info.ndim = ndim
5580  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5581  */
5582  __pyx_v_info->buf = PyArray_DATA(__pyx_v_self);
5583 
5584  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":236
5585  *
5586  * info.buf = PyArray_DATA(self)
5587  * info.ndim = ndim # <<<<<<<<<<<<<<
5588  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
5589  * # Allocate new buffer for strides and shape info.
5590  */
5591  __pyx_v_info->ndim = __pyx_v_ndim;
5592 
5593  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
5594  * info.buf = PyArray_DATA(self)
5595  * info.ndim = ndim
5596  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
5597  * # Allocate new buffer for strides and shape info.
5598  * # This is allocated as one block, strides first.
5599  */
5600  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
5601  if (__pyx_t_1) {
5602 
5603  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":240
5604  * # Allocate new buffer for strides and shape info.
5605  * # This is allocated as one block, strides first.
5606  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim) # <<<<<<<<<<<<<<
5607  * info.shape = info.strides + ndim
5608  * for i in range(ndim):
5609  */
5610  __pyx_v_info->strides = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * 2) * ((size_t)__pyx_v_ndim))));
5611 
5612  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":241
5613  * # This is allocated as one block, strides first.
5614  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
5615  * info.shape = info.strides + ndim # <<<<<<<<<<<<<<
5616  * for i in range(ndim):
5617  * info.strides[i] = PyArray_STRIDES(self)[i]
5618  */
5619  __pyx_v_info->shape = (__pyx_v_info->strides + __pyx_v_ndim);
5620 
5621  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":242
5622  * info.strides = <Py_ssize_t*>PyObject_Malloc(sizeof(Py_ssize_t) * 2 * <size_t>ndim)
5623  * info.shape = info.strides + ndim
5624  * for i in range(ndim): # <<<<<<<<<<<<<<
5625  * info.strides[i] = PyArray_STRIDES(self)[i]
5626  * info.shape[i] = PyArray_DIMS(self)[i]
5627  */
5628  __pyx_t_4 = __pyx_v_ndim;
5629  __pyx_t_5 = __pyx_t_4;
5630  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
5631  __pyx_v_i = __pyx_t_6;
5632 
5633  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":243
5634  * info.shape = info.strides + ndim
5635  * for i in range(ndim):
5636  * info.strides[i] = PyArray_STRIDES(self)[i] # <<<<<<<<<<<<<<
5637  * info.shape[i] = PyArray_DIMS(self)[i]
5638  * else:
5639  */
5640  (__pyx_v_info->strides[__pyx_v_i]) = (PyArray_STRIDES(__pyx_v_self)[__pyx_v_i]);
5641 
5642  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":244
5643  * for i in range(ndim):
5644  * info.strides[i] = PyArray_STRIDES(self)[i]
5645  * info.shape[i] = PyArray_DIMS(self)[i] # <<<<<<<<<<<<<<
5646  * else:
5647  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5648  */
5649  (__pyx_v_info->shape[__pyx_v_i]) = (PyArray_DIMS(__pyx_v_self)[__pyx_v_i]);
5650  }
5651 
5652  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":237
5653  * info.buf = PyArray_DATA(self)
5654  * info.ndim = ndim
5655  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
5656  * # Allocate new buffer for strides and shape info.
5657  * # This is allocated as one block, strides first.
5658  */
5659  goto __pyx_L9;
5660  }
5661 
5662  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":246
5663  * info.shape[i] = PyArray_DIMS(self)[i]
5664  * else:
5665  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self) # <<<<<<<<<<<<<<
5666  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5667  * info.suboffsets = NULL
5668  */
5669  /*else*/ {
5670  __pyx_v_info->strides = ((Py_ssize_t *)PyArray_STRIDES(__pyx_v_self));
5671 
5672  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":247
5673  * else:
5674  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5675  * info.shape = <Py_ssize_t*>PyArray_DIMS(self) # <<<<<<<<<<<<<<
5676  * info.suboffsets = NULL
5677  * info.itemsize = PyArray_ITEMSIZE(self)
5678  */
5679  __pyx_v_info->shape = ((Py_ssize_t *)PyArray_DIMS(__pyx_v_self));
5680  }
5681  __pyx_L9:;
5682 
5683  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":248
5684  * info.strides = <Py_ssize_t*>PyArray_STRIDES(self)
5685  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5686  * info.suboffsets = NULL # <<<<<<<<<<<<<<
5687  * info.itemsize = PyArray_ITEMSIZE(self)
5688  * info.readonly = not PyArray_ISWRITEABLE(self)
5689  */
5690  __pyx_v_info->suboffsets = NULL;
5691 
5692  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":249
5693  * info.shape = <Py_ssize_t*>PyArray_DIMS(self)
5694  * info.suboffsets = NULL
5695  * info.itemsize = PyArray_ITEMSIZE(self) # <<<<<<<<<<<<<<
5696  * info.readonly = not PyArray_ISWRITEABLE(self)
5697  *
5698  */
5699  __pyx_v_info->itemsize = PyArray_ITEMSIZE(__pyx_v_self);
5700 
5701  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":250
5702  * info.suboffsets = NULL
5703  * info.itemsize = PyArray_ITEMSIZE(self)
5704  * info.readonly = not PyArray_ISWRITEABLE(self) # <<<<<<<<<<<<<<
5705  *
5706  * cdef int t
5707  */
5708  __pyx_v_info->readonly = (!(PyArray_ISWRITEABLE(__pyx_v_self) != 0));
5709 
5710  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":253
5711  *
5712  * cdef int t
5713  * cdef char* f = NULL # <<<<<<<<<<<<<<
5714  * cdef dtype descr = self.descr
5715  * cdef int offset
5716  */
5717  __pyx_v_f = NULL;
5718 
5719  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":254
5720  * cdef int t
5721  * cdef char* f = NULL
5722  * cdef dtype descr = self.descr # <<<<<<<<<<<<<<
5723  * cdef int offset
5724  *
5725  */
5726  __pyx_t_3 = ((PyObject *)__pyx_v_self->descr);
5727  __Pyx_INCREF(__pyx_t_3);
5728  __pyx_v_descr = ((PyArray_Descr *)__pyx_t_3);
5729  __pyx_t_3 = 0;
5730 
5731  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":257
5732  * cdef int offset
5733  *
5734  * info.obj = self # <<<<<<<<<<<<<<
5735  *
5736  * if not PyDataType_HASFIELDS(descr):
5737  */
5738  __Pyx_INCREF(((PyObject *)__pyx_v_self));
5739  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
5740  __Pyx_GOTREF(__pyx_v_info->obj);
5741  __Pyx_DECREF(__pyx_v_info->obj);
5742  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
5743 
5744  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
5745  * info.obj = self
5746  *
5747  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
5748  * t = descr.type_num
5749  * if ((descr.byteorder == c'>' and little_endian) or
5750  */
5751  __pyx_t_1 = ((!(PyDataType_HASFIELDS(__pyx_v_descr) != 0)) != 0);
5752  if (__pyx_t_1) {
5753 
5754  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":260
5755  *
5756  * if not PyDataType_HASFIELDS(descr):
5757  * t = descr.type_num # <<<<<<<<<<<<<<
5758  * if ((descr.byteorder == c'>' and little_endian) or
5759  * (descr.byteorder == c'<' and not little_endian)):
5760  */
5761  __pyx_t_4 = __pyx_v_descr->type_num;
5762  __pyx_v_t = __pyx_t_4;
5763 
5764  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
5765  * if not PyDataType_HASFIELDS(descr):
5766  * t = descr.type_num
5767  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5768  * (descr.byteorder == c'<' and not little_endian)):
5769  * raise ValueError(u"Non-native byte order not supported")
5770  */
5771  __pyx_t_2 = ((__pyx_v_descr->byteorder == '>') != 0);
5772  if (!__pyx_t_2) {
5773  goto __pyx_L15_next_or;
5774  } else {
5775  }
5776  __pyx_t_2 = (__pyx_v_little_endian != 0);
5777  if (!__pyx_t_2) {
5778  } else {
5779  __pyx_t_1 = __pyx_t_2;
5780  goto __pyx_L14_bool_binop_done;
5781  }
5782  __pyx_L15_next_or:;
5783 
5784  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":262
5785  * t = descr.type_num
5786  * if ((descr.byteorder == c'>' and little_endian) or
5787  * (descr.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
5788  * raise ValueError(u"Non-native byte order not supported")
5789  * if t == NPY_BYTE: f = "b"
5790  */
5791  __pyx_t_2 = ((__pyx_v_descr->byteorder == '<') != 0);
5792  if (__pyx_t_2) {
5793  } else {
5794  __pyx_t_1 = __pyx_t_2;
5795  goto __pyx_L14_bool_binop_done;
5796  }
5797  __pyx_t_2 = ((!(__pyx_v_little_endian != 0)) != 0);
5798  __pyx_t_1 = __pyx_t_2;
5799  __pyx_L14_bool_binop_done:;
5800 
5801  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
5802  * if not PyDataType_HASFIELDS(descr):
5803  * t = descr.type_num
5804  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5805  * (descr.byteorder == c'<' and not little_endian)):
5806  * raise ValueError(u"Non-native byte order not supported")
5807  */
5808  if (unlikely(__pyx_t_1)) {
5809 
5810  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
5811  * if ((descr.byteorder == c'>' and little_endian) or
5812  * (descr.byteorder == c'<' and not little_endian)):
5813  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
5814  * if t == NPY_BYTE: f = "b"
5815  * elif t == NPY_UBYTE: f = "B"
5816  */
5817  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__5, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 263, __pyx_L1_error)
5818  __Pyx_GOTREF(__pyx_t_3);
5819  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
5820  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
5821  __PYX_ERR(3, 263, __pyx_L1_error)
5822 
5823  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":261
5824  * if not PyDataType_HASFIELDS(descr):
5825  * t = descr.type_num
5826  * if ((descr.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
5827  * (descr.byteorder == c'<' and not little_endian)):
5828  * raise ValueError(u"Non-native byte order not supported")
5829  */
5830  }
5831 
5832  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":264
5833  * (descr.byteorder == c'<' and not little_endian)):
5834  * raise ValueError(u"Non-native byte order not supported")
5835  * if t == NPY_BYTE: f = "b" # <<<<<<<<<<<<<<
5836  * elif t == NPY_UBYTE: f = "B"
5837  * elif t == NPY_SHORT: f = "h"
5838  */
5839  switch (__pyx_v_t) {
5840  case NPY_BYTE:
5841  __pyx_v_f = ((char *)"b");
5842  break;
5843 
5844  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":265
5845  * raise ValueError(u"Non-native byte order not supported")
5846  * if t == NPY_BYTE: f = "b"
5847  * elif t == NPY_UBYTE: f = "B" # <<<<<<<<<<<<<<
5848  * elif t == NPY_SHORT: f = "h"
5849  * elif t == NPY_USHORT: f = "H"
5850  */
5851  case NPY_UBYTE:
5852  __pyx_v_f = ((char *)"B");
5853  break;
5854 
5855  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":266
5856  * if t == NPY_BYTE: f = "b"
5857  * elif t == NPY_UBYTE: f = "B"
5858  * elif t == NPY_SHORT: f = "h" # <<<<<<<<<<<<<<
5859  * elif t == NPY_USHORT: f = "H"
5860  * elif t == NPY_INT: f = "i"
5861  */
5862  case NPY_SHORT:
5863  __pyx_v_f = ((char *)"h");
5864  break;
5865 
5866  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":267
5867  * elif t == NPY_UBYTE: f = "B"
5868  * elif t == NPY_SHORT: f = "h"
5869  * elif t == NPY_USHORT: f = "H" # <<<<<<<<<<<<<<
5870  * elif t == NPY_INT: f = "i"
5871  * elif t == NPY_UINT: f = "I"
5872  */
5873  case NPY_USHORT:
5874  __pyx_v_f = ((char *)"H");
5875  break;
5876 
5877  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":268
5878  * elif t == NPY_SHORT: f = "h"
5879  * elif t == NPY_USHORT: f = "H"
5880  * elif t == NPY_INT: f = "i" # <<<<<<<<<<<<<<
5881  * elif t == NPY_UINT: f = "I"
5882  * elif t == NPY_LONG: f = "l"
5883  */
5884  case NPY_INT:
5885  __pyx_v_f = ((char *)"i");
5886  break;
5887 
5888  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":269
5889  * elif t == NPY_USHORT: f = "H"
5890  * elif t == NPY_INT: f = "i"
5891  * elif t == NPY_UINT: f = "I" # <<<<<<<<<<<<<<
5892  * elif t == NPY_LONG: f = "l"
5893  * elif t == NPY_ULONG: f = "L"
5894  */
5895  case NPY_UINT:
5896  __pyx_v_f = ((char *)"I");
5897  break;
5898 
5899  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":270
5900  * elif t == NPY_INT: f = "i"
5901  * elif t == NPY_UINT: f = "I"
5902  * elif t == NPY_LONG: f = "l" # <<<<<<<<<<<<<<
5903  * elif t == NPY_ULONG: f = "L"
5904  * elif t == NPY_LONGLONG: f = "q"
5905  */
5906  case NPY_LONG:
5907  __pyx_v_f = ((char *)"l");
5908  break;
5909 
5910  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":271
5911  * elif t == NPY_UINT: f = "I"
5912  * elif t == NPY_LONG: f = "l"
5913  * elif t == NPY_ULONG: f = "L" # <<<<<<<<<<<<<<
5914  * elif t == NPY_LONGLONG: f = "q"
5915  * elif t == NPY_ULONGLONG: f = "Q"
5916  */
5917  case NPY_ULONG:
5918  __pyx_v_f = ((char *)"L");
5919  break;
5920 
5921  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":272
5922  * elif t == NPY_LONG: f = "l"
5923  * elif t == NPY_ULONG: f = "L"
5924  * elif t == NPY_LONGLONG: f = "q" # <<<<<<<<<<<<<<
5925  * elif t == NPY_ULONGLONG: f = "Q"
5926  * elif t == NPY_FLOAT: f = "f"
5927  */
5928  case NPY_LONGLONG:
5929  __pyx_v_f = ((char *)"q");
5930  break;
5931 
5932  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":273
5933  * elif t == NPY_ULONG: f = "L"
5934  * elif t == NPY_LONGLONG: f = "q"
5935  * elif t == NPY_ULONGLONG: f = "Q" # <<<<<<<<<<<<<<
5936  * elif t == NPY_FLOAT: f = "f"
5937  * elif t == NPY_DOUBLE: f = "d"
5938  */
5939  case NPY_ULONGLONG:
5940  __pyx_v_f = ((char *)"Q");
5941  break;
5942 
5943  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":274
5944  * elif t == NPY_LONGLONG: f = "q"
5945  * elif t == NPY_ULONGLONG: f = "Q"
5946  * elif t == NPY_FLOAT: f = "f" # <<<<<<<<<<<<<<
5947  * elif t == NPY_DOUBLE: f = "d"
5948  * elif t == NPY_LONGDOUBLE: f = "g"
5949  */
5950  case NPY_FLOAT:
5951  __pyx_v_f = ((char *)"f");
5952  break;
5953 
5954  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":275
5955  * elif t == NPY_ULONGLONG: f = "Q"
5956  * elif t == NPY_FLOAT: f = "f"
5957  * elif t == NPY_DOUBLE: f = "d" # <<<<<<<<<<<<<<
5958  * elif t == NPY_LONGDOUBLE: f = "g"
5959  * elif t == NPY_CFLOAT: f = "Zf"
5960  */
5961  case NPY_DOUBLE:
5962  __pyx_v_f = ((char *)"d");
5963  break;
5964 
5965  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":276
5966  * elif t == NPY_FLOAT: f = "f"
5967  * elif t == NPY_DOUBLE: f = "d"
5968  * elif t == NPY_LONGDOUBLE: f = "g" # <<<<<<<<<<<<<<
5969  * elif t == NPY_CFLOAT: f = "Zf"
5970  * elif t == NPY_CDOUBLE: f = "Zd"
5971  */
5972  case NPY_LONGDOUBLE:
5973  __pyx_v_f = ((char *)"g");
5974  break;
5975 
5976  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":277
5977  * elif t == NPY_DOUBLE: f = "d"
5978  * elif t == NPY_LONGDOUBLE: f = "g"
5979  * elif t == NPY_CFLOAT: f = "Zf" # <<<<<<<<<<<<<<
5980  * elif t == NPY_CDOUBLE: f = "Zd"
5981  * elif t == NPY_CLONGDOUBLE: f = "Zg"
5982  */
5983  case NPY_CFLOAT:
5984  __pyx_v_f = ((char *)"Zf");
5985  break;
5986 
5987  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":278
5988  * elif t == NPY_LONGDOUBLE: f = "g"
5989  * elif t == NPY_CFLOAT: f = "Zf"
5990  * elif t == NPY_CDOUBLE: f = "Zd" # <<<<<<<<<<<<<<
5991  * elif t == NPY_CLONGDOUBLE: f = "Zg"
5992  * elif t == NPY_OBJECT: f = "O"
5993  */
5994  case NPY_CDOUBLE:
5995  __pyx_v_f = ((char *)"Zd");
5996  break;
5997 
5998  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":279
5999  * elif t == NPY_CFLOAT: f = "Zf"
6000  * elif t == NPY_CDOUBLE: f = "Zd"
6001  * elif t == NPY_CLONGDOUBLE: f = "Zg" # <<<<<<<<<<<<<<
6002  * elif t == NPY_OBJECT: f = "O"
6003  * else:
6004  */
6005  case NPY_CLONGDOUBLE:
6006  __pyx_v_f = ((char *)"Zg");
6007  break;
6008 
6009  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":280
6010  * elif t == NPY_CDOUBLE: f = "Zd"
6011  * elif t == NPY_CLONGDOUBLE: f = "Zg"
6012  * elif t == NPY_OBJECT: f = "O" # <<<<<<<<<<<<<<
6013  * else:
6014  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6015  */
6016  case NPY_OBJECT:
6017  __pyx_v_f = ((char *)"O");
6018  break;
6019  default:
6020 
6021  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":282
6022  * elif t == NPY_OBJECT: f = "O"
6023  * else:
6024  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
6025  * info.format = f
6026  * return
6027  */
6028  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
6029  __Pyx_GOTREF(__pyx_t_3);
6030  __pyx_t_7 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_t_3); if (unlikely(!__pyx_t_7)) __PYX_ERR(3, 282, __pyx_L1_error)
6031  __Pyx_GOTREF(__pyx_t_7);
6032  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6033  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_7); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 282, __pyx_L1_error)
6034  __Pyx_GOTREF(__pyx_t_3);
6035  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
6036  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6037  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6038  __PYX_ERR(3, 282, __pyx_L1_error)
6039  break;
6040  }
6041 
6042  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":283
6043  * else:
6044  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6045  * info.format = f # <<<<<<<<<<<<<<
6046  * return
6047  * else:
6048  */
6049  __pyx_v_info->format = __pyx_v_f;
6050 
6051  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":284
6052  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
6053  * info.format = f
6054  * return # <<<<<<<<<<<<<<
6055  * else:
6056  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6057  */
6058  __pyx_r = 0;
6059  goto __pyx_L0;
6060 
6061  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":259
6062  * info.obj = self
6063  *
6064  * if not PyDataType_HASFIELDS(descr): # <<<<<<<<<<<<<<
6065  * t = descr.type_num
6066  * if ((descr.byteorder == c'>' and little_endian) or
6067  */
6068  }
6069 
6070  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":286
6071  * return
6072  * else:
6073  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len) # <<<<<<<<<<<<<<
6074  * info.format[0] = c'^' # Native data types, manual alignment
6075  * offset = 0
6076  */
6077  /*else*/ {
6078  __pyx_v_info->format = ((char *)PyObject_Malloc(0xFF));
6079 
6080  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":287
6081  * else:
6082  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6083  * info.format[0] = c'^' # Native data types, manual alignment # <<<<<<<<<<<<<<
6084  * offset = 0
6085  * f = _util_dtypestring(descr, info.format + 1,
6086  */
6087  (__pyx_v_info->format[0]) = '^';
6088 
6089  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":288
6090  * info.format = <char*>PyObject_Malloc(_buffer_format_string_len)
6091  * info.format[0] = c'^' # Native data types, manual alignment
6092  * offset = 0 # <<<<<<<<<<<<<<
6093  * f = _util_dtypestring(descr, info.format + 1,
6094  * info.format + _buffer_format_string_len,
6095  */
6096  __pyx_v_offset = 0;
6097 
6098  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":289
6099  * info.format[0] = c'^' # Native data types, manual alignment
6100  * offset = 0
6101  * f = _util_dtypestring(descr, info.format + 1, # <<<<<<<<<<<<<<
6102  * info.format + _buffer_format_string_len,
6103  * &offset)
6104  */
6105  __pyx_t_8 = __pyx_f_5numpy__util_dtypestring(__pyx_v_descr, (__pyx_v_info->format + 1), (__pyx_v_info->format + 0xFF), (&__pyx_v_offset)); if (unlikely(__pyx_t_8 == ((char *)NULL))) __PYX_ERR(3, 289, __pyx_L1_error)
6106  __pyx_v_f = __pyx_t_8;
6107 
6108  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":292
6109  * info.format + _buffer_format_string_len,
6110  * &offset)
6111  * f[0] = c'\0' # Terminate format string # <<<<<<<<<<<<<<
6112  *
6113  * def __releasebuffer__(ndarray self, Py_buffer* info):
6114  */
6115  (__pyx_v_f[0]) = '\x00';
6116  }
6117 
6118  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":215
6119  * # experimental exception made for __getbuffer__ and __releasebuffer__
6120  * # -- the details of this may change.
6121  * def __getbuffer__(ndarray self, Py_buffer* info, int flags): # <<<<<<<<<<<<<<
6122  * # This implementation of getbuffer is geared towards Cython
6123  * # requirements, and does not yet fulfill the PEP.
6124  */
6125 
6126  /* function exit code */
6127  __pyx_r = 0;
6128  goto __pyx_L0;
6129  __pyx_L1_error:;
6130  __Pyx_XDECREF(__pyx_t_3);
6131  __Pyx_XDECREF(__pyx_t_7);
6132  __Pyx_AddTraceback("numpy.ndarray.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
6133  __pyx_r = -1;
6134  if (__pyx_v_info->obj != NULL) {
6135  __Pyx_GOTREF(__pyx_v_info->obj);
6136  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6137  }
6138  goto __pyx_L2;
6139  __pyx_L0:;
6140  if (__pyx_v_info->obj == Py_None) {
6141  __Pyx_GOTREF(__pyx_v_info->obj);
6142  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
6143  }
6144  __pyx_L2:;
6145  __Pyx_XDECREF((PyObject *)__pyx_v_descr);
6146  __Pyx_RefNannyFinishContext();
6147  return __pyx_r;
6148 }
6149 
6150 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
6151  * f[0] = c'\0' # Terminate format string
6152  *
6153  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6154  * if PyArray_HASFIELDS(self):
6155  * PyObject_Free(info.format)
6156  */
6157 
6158 /* Python wrapper */
6159 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info); /*proto*/
6160 static CYTHON_UNUSED void __pyx_pw_5numpy_7ndarray_3__releasebuffer__(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6161  __Pyx_RefNannyDeclarations
6162  __Pyx_RefNannySetupContext("__releasebuffer__ (wrapper)", 0);
6163  __pyx_pf_5numpy_7ndarray_2__releasebuffer__(((PyArrayObject *)__pyx_v_self), ((Py_buffer *)__pyx_v_info));
6164 
6165  /* function exit code */
6166  __Pyx_RefNannyFinishContext();
6167 }
6168 
6169 static void __pyx_pf_5numpy_7ndarray_2__releasebuffer__(PyArrayObject *__pyx_v_self, Py_buffer *__pyx_v_info) {
6170  __Pyx_RefNannyDeclarations
6171  int __pyx_t_1;
6172  __Pyx_RefNannySetupContext("__releasebuffer__", 0);
6173 
6174  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
6175  *
6176  * def __releasebuffer__(ndarray self, Py_buffer* info):
6177  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6178  * PyObject_Free(info.format)
6179  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6180  */
6181  __pyx_t_1 = (PyArray_HASFIELDS(__pyx_v_self) != 0);
6182  if (__pyx_t_1) {
6183 
6184  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":296
6185  * def __releasebuffer__(ndarray self, Py_buffer* info):
6186  * if PyArray_HASFIELDS(self):
6187  * PyObject_Free(info.format) # <<<<<<<<<<<<<<
6188  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6189  * PyObject_Free(info.strides)
6190  */
6191  PyObject_Free(__pyx_v_info->format);
6192 
6193  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":295
6194  *
6195  * def __releasebuffer__(ndarray self, Py_buffer* info):
6196  * if PyArray_HASFIELDS(self): # <<<<<<<<<<<<<<
6197  * PyObject_Free(info.format)
6198  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6199  */
6200  }
6201 
6202  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6203  * if PyArray_HASFIELDS(self):
6204  * PyObject_Free(info.format)
6205  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6206  * PyObject_Free(info.strides)
6207  * # info.shape was stored after info.strides in the same block
6208  */
6209  __pyx_t_1 = (((sizeof(npy_intp)) != (sizeof(Py_ssize_t))) != 0);
6210  if (__pyx_t_1) {
6211 
6212  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":298
6213  * PyObject_Free(info.format)
6214  * if sizeof(npy_intp) != sizeof(Py_ssize_t):
6215  * PyObject_Free(info.strides) # <<<<<<<<<<<<<<
6216  * # info.shape was stored after info.strides in the same block
6217  *
6218  */
6219  PyObject_Free(__pyx_v_info->strides);
6220 
6221  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":297
6222  * if PyArray_HASFIELDS(self):
6223  * PyObject_Free(info.format)
6224  * if sizeof(npy_intp) != sizeof(Py_ssize_t): # <<<<<<<<<<<<<<
6225  * PyObject_Free(info.strides)
6226  * # info.shape was stored after info.strides in the same block
6227  */
6228  }
6229 
6230  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":294
6231  * f[0] = c'\0' # Terminate format string
6232  *
6233  * def __releasebuffer__(ndarray self, Py_buffer* info): # <<<<<<<<<<<<<<
6234  * if PyArray_HASFIELDS(self):
6235  * PyObject_Free(info.format)
6236  */
6237 
6238  /* function exit code */
6239  __Pyx_RefNannyFinishContext();
6240 }
6241 
6242 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
6243  * ctypedef npy_cdouble complex_t
6244  *
6245  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6246  * return PyArray_MultiIterNew(1, <void*>a)
6247  *
6248  */
6249 
6250 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew1(PyObject *__pyx_v_a) {
6251  PyObject *__pyx_r = NULL;
6252  __Pyx_RefNannyDeclarations
6253  PyObject *__pyx_t_1 = NULL;
6254  __Pyx_RefNannySetupContext("PyArray_MultiIterNew1", 0);
6255 
6256  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":776
6257  *
6258  * cdef inline object PyArray_MultiIterNew1(a):
6259  * return PyArray_MultiIterNew(1, <void*>a) # <<<<<<<<<<<<<<
6260  *
6261  * cdef inline object PyArray_MultiIterNew2(a, b):
6262  */
6263  __Pyx_XDECREF(__pyx_r);
6264  __pyx_t_1 = PyArray_MultiIterNew(1, ((void *)__pyx_v_a)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 776, __pyx_L1_error)
6265  __Pyx_GOTREF(__pyx_t_1);
6266  __pyx_r = __pyx_t_1;
6267  __pyx_t_1 = 0;
6268  goto __pyx_L0;
6269 
6270  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":775
6271  * ctypedef npy_cdouble complex_t
6272  *
6273  * cdef inline object PyArray_MultiIterNew1(a): # <<<<<<<<<<<<<<
6274  * return PyArray_MultiIterNew(1, <void*>a)
6275  *
6276  */
6277 
6278  /* function exit code */
6279  __pyx_L1_error:;
6280  __Pyx_XDECREF(__pyx_t_1);
6281  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew1", __pyx_clineno, __pyx_lineno, __pyx_filename);
6282  __pyx_r = 0;
6283  __pyx_L0:;
6284  __Pyx_XGIVEREF(__pyx_r);
6285  __Pyx_RefNannyFinishContext();
6286  return __pyx_r;
6287 }
6288 
6289 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
6290  * return PyArray_MultiIterNew(1, <void*>a)
6291  *
6292  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6293  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6294  *
6295  */
6296 
6297 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew2(PyObject *__pyx_v_a, PyObject *__pyx_v_b) {
6298  PyObject *__pyx_r = NULL;
6299  __Pyx_RefNannyDeclarations
6300  PyObject *__pyx_t_1 = NULL;
6301  __Pyx_RefNannySetupContext("PyArray_MultiIterNew2", 0);
6302 
6303  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":779
6304  *
6305  * cdef inline object PyArray_MultiIterNew2(a, b):
6306  * return PyArray_MultiIterNew(2, <void*>a, <void*>b) # <<<<<<<<<<<<<<
6307  *
6308  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6309  */
6310  __Pyx_XDECREF(__pyx_r);
6311  __pyx_t_1 = PyArray_MultiIterNew(2, ((void *)__pyx_v_a), ((void *)__pyx_v_b)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 779, __pyx_L1_error)
6312  __Pyx_GOTREF(__pyx_t_1);
6313  __pyx_r = __pyx_t_1;
6314  __pyx_t_1 = 0;
6315  goto __pyx_L0;
6316 
6317  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":778
6318  * return PyArray_MultiIterNew(1, <void*>a)
6319  *
6320  * cdef inline object PyArray_MultiIterNew2(a, b): # <<<<<<<<<<<<<<
6321  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6322  *
6323  */
6324 
6325  /* function exit code */
6326  __pyx_L1_error:;
6327  __Pyx_XDECREF(__pyx_t_1);
6328  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew2", __pyx_clineno, __pyx_lineno, __pyx_filename);
6329  __pyx_r = 0;
6330  __pyx_L0:;
6331  __Pyx_XGIVEREF(__pyx_r);
6332  __Pyx_RefNannyFinishContext();
6333  return __pyx_r;
6334 }
6335 
6336 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
6337  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6338  *
6339  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6340  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6341  *
6342  */
6343 
6344 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew3(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c) {
6345  PyObject *__pyx_r = NULL;
6346  __Pyx_RefNannyDeclarations
6347  PyObject *__pyx_t_1 = NULL;
6348  __Pyx_RefNannySetupContext("PyArray_MultiIterNew3", 0);
6349 
6350  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":782
6351  *
6352  * cdef inline object PyArray_MultiIterNew3(a, b, c):
6353  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c) # <<<<<<<<<<<<<<
6354  *
6355  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6356  */
6357  __Pyx_XDECREF(__pyx_r);
6358  __pyx_t_1 = PyArray_MultiIterNew(3, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 782, __pyx_L1_error)
6359  __Pyx_GOTREF(__pyx_t_1);
6360  __pyx_r = __pyx_t_1;
6361  __pyx_t_1 = 0;
6362  goto __pyx_L0;
6363 
6364  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":781
6365  * return PyArray_MultiIterNew(2, <void*>a, <void*>b)
6366  *
6367  * cdef inline object PyArray_MultiIterNew3(a, b, c): # <<<<<<<<<<<<<<
6368  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6369  *
6370  */
6371 
6372  /* function exit code */
6373  __pyx_L1_error:;
6374  __Pyx_XDECREF(__pyx_t_1);
6375  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew3", __pyx_clineno, __pyx_lineno, __pyx_filename);
6376  __pyx_r = 0;
6377  __pyx_L0:;
6378  __Pyx_XGIVEREF(__pyx_r);
6379  __Pyx_RefNannyFinishContext();
6380  return __pyx_r;
6381 }
6382 
6383 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
6384  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6385  *
6386  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6387  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6388  *
6389  */
6390 
6391 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew4(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d) {
6392  PyObject *__pyx_r = NULL;
6393  __Pyx_RefNannyDeclarations
6394  PyObject *__pyx_t_1 = NULL;
6395  __Pyx_RefNannySetupContext("PyArray_MultiIterNew4", 0);
6396 
6397  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":785
6398  *
6399  * cdef inline object PyArray_MultiIterNew4(a, b, c, d):
6400  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d) # <<<<<<<<<<<<<<
6401  *
6402  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6403  */
6404  __Pyx_XDECREF(__pyx_r);
6405  __pyx_t_1 = PyArray_MultiIterNew(4, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 785, __pyx_L1_error)
6406  __Pyx_GOTREF(__pyx_t_1);
6407  __pyx_r = __pyx_t_1;
6408  __pyx_t_1 = 0;
6409  goto __pyx_L0;
6410 
6411  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":784
6412  * return PyArray_MultiIterNew(3, <void*>a, <void*>b, <void*> c)
6413  *
6414  * cdef inline object PyArray_MultiIterNew4(a, b, c, d): # <<<<<<<<<<<<<<
6415  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6416  *
6417  */
6418 
6419  /* function exit code */
6420  __pyx_L1_error:;
6421  __Pyx_XDECREF(__pyx_t_1);
6422  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew4", __pyx_clineno, __pyx_lineno, __pyx_filename);
6423  __pyx_r = 0;
6424  __pyx_L0:;
6425  __Pyx_XGIVEREF(__pyx_r);
6426  __Pyx_RefNannyFinishContext();
6427  return __pyx_r;
6428 }
6429 
6430 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":787
6431  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6432  *
6433  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6434  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6435  *
6436  */
6437 
6438 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyArray_MultiIterNew5(PyObject *__pyx_v_a, PyObject *__pyx_v_b, PyObject *__pyx_v_c, PyObject *__pyx_v_d, PyObject *__pyx_v_e) {
6439  PyObject *__pyx_r = NULL;
6440  __Pyx_RefNannyDeclarations
6441  PyObject *__pyx_t_1 = NULL;
6442  __Pyx_RefNannySetupContext("PyArray_MultiIterNew5", 0);
6443 
6444  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":788
6445  *
6446  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e):
6447  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e) # <<<<<<<<<<<<<<
6448  *
6449  * cdef inline tuple PyDataType_SHAPE(dtype d):
6450  */
6451  __Pyx_XDECREF(__pyx_r);
6452  __pyx_t_1 = PyArray_MultiIterNew(5, ((void *)__pyx_v_a), ((void *)__pyx_v_b), ((void *)__pyx_v_c), ((void *)__pyx_v_d), ((void *)__pyx_v_e)); if (unlikely(!__pyx_t_1)) __PYX_ERR(3, 788, __pyx_L1_error)
6453  __Pyx_GOTREF(__pyx_t_1);
6454  __pyx_r = __pyx_t_1;
6455  __pyx_t_1 = 0;
6456  goto __pyx_L0;
6457 
6458  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":787
6459  * return PyArray_MultiIterNew(4, <void*>a, <void*>b, <void*>c, <void*> d)
6460  *
6461  * cdef inline object PyArray_MultiIterNew5(a, b, c, d, e): # <<<<<<<<<<<<<<
6462  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6463  *
6464  */
6465 
6466  /* function exit code */
6467  __pyx_L1_error:;
6468  __Pyx_XDECREF(__pyx_t_1);
6469  __Pyx_AddTraceback("numpy.PyArray_MultiIterNew5", __pyx_clineno, __pyx_lineno, __pyx_filename);
6470  __pyx_r = 0;
6471  __pyx_L0:;
6472  __Pyx_XGIVEREF(__pyx_r);
6473  __Pyx_RefNannyFinishContext();
6474  return __pyx_r;
6475 }
6476 
6477 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
6478  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6479  *
6480  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6481  * if PyDataType_HASSUBARRAY(d):
6482  * return <tuple>d.subarray.shape
6483  */
6484 
6485 static CYTHON_INLINE PyObject *__pyx_f_5numpy_PyDataType_SHAPE(PyArray_Descr *__pyx_v_d) {
6486  PyObject *__pyx_r = NULL;
6487  __Pyx_RefNannyDeclarations
6488  int __pyx_t_1;
6489  __Pyx_RefNannySetupContext("PyDataType_SHAPE", 0);
6490 
6491  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
6492  *
6493  * cdef inline tuple PyDataType_SHAPE(dtype d):
6494  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6495  * return <tuple>d.subarray.shape
6496  * else:
6497  */
6498  __pyx_t_1 = (PyDataType_HASSUBARRAY(__pyx_v_d) != 0);
6499  if (__pyx_t_1) {
6500 
6501  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":792
6502  * cdef inline tuple PyDataType_SHAPE(dtype d):
6503  * if PyDataType_HASSUBARRAY(d):
6504  * return <tuple>d.subarray.shape # <<<<<<<<<<<<<<
6505  * else:
6506  * return ()
6507  */
6508  __Pyx_XDECREF(__pyx_r);
6509  __Pyx_INCREF(((PyObject*)__pyx_v_d->subarray->shape));
6510  __pyx_r = ((PyObject*)__pyx_v_d->subarray->shape);
6511  goto __pyx_L0;
6512 
6513  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":791
6514  *
6515  * cdef inline tuple PyDataType_SHAPE(dtype d):
6516  * if PyDataType_HASSUBARRAY(d): # <<<<<<<<<<<<<<
6517  * return <tuple>d.subarray.shape
6518  * else:
6519  */
6520  }
6521 
6522  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":794
6523  * return <tuple>d.subarray.shape
6524  * else:
6525  * return () # <<<<<<<<<<<<<<
6526  *
6527  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL:
6528  */
6529  /*else*/ {
6530  __Pyx_XDECREF(__pyx_r);
6531  __Pyx_INCREF(__pyx_empty_tuple);
6532  __pyx_r = __pyx_empty_tuple;
6533  goto __pyx_L0;
6534  }
6535 
6536  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":790
6537  * return PyArray_MultiIterNew(5, <void*>a, <void*>b, <void*>c, <void*> d, <void*> e)
6538  *
6539  * cdef inline tuple PyDataType_SHAPE(dtype d): # <<<<<<<<<<<<<<
6540  * if PyDataType_HASSUBARRAY(d):
6541  * return <tuple>d.subarray.shape
6542  */
6543 
6544  /* function exit code */
6545  __pyx_L0:;
6546  __Pyx_XGIVEREF(__pyx_r);
6547  __Pyx_RefNannyFinishContext();
6548  return __pyx_r;
6549 }
6550 
6551 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
6552  * return ()
6553  *
6554  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
6555  * # Recursive utility function used in __getbuffer__ to get format
6556  * # string. The new location in the format string is returned.
6557  */
6558 
6559 static CYTHON_INLINE char *__pyx_f_5numpy__util_dtypestring(PyArray_Descr *__pyx_v_descr, char *__pyx_v_f, char *__pyx_v_end, int *__pyx_v_offset) {
6560  PyArray_Descr *__pyx_v_child = 0;
6561  int __pyx_v_endian_detector;
6562  int __pyx_v_little_endian;
6563  PyObject *__pyx_v_fields = 0;
6564  PyObject *__pyx_v_childname = NULL;
6565  PyObject *__pyx_v_new_offset = NULL;
6566  PyObject *__pyx_v_t = NULL;
6567  char *__pyx_r;
6568  __Pyx_RefNannyDeclarations
6569  PyObject *__pyx_t_1 = NULL;
6570  Py_ssize_t __pyx_t_2;
6571  PyObject *__pyx_t_3 = NULL;
6572  PyObject *__pyx_t_4 = NULL;
6573  int __pyx_t_5;
6574  int __pyx_t_6;
6575  int __pyx_t_7;
6576  long __pyx_t_8;
6577  char *__pyx_t_9;
6578  __Pyx_RefNannySetupContext("_util_dtypestring", 0);
6579 
6580  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":801
6581  *
6582  * cdef dtype child
6583  * cdef int endian_detector = 1 # <<<<<<<<<<<<<<
6584  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0)
6585  * cdef tuple fields
6586  */
6587  __pyx_v_endian_detector = 1;
6588 
6589  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":802
6590  * cdef dtype child
6591  * cdef int endian_detector = 1
6592  * cdef bint little_endian = ((<char*>&endian_detector)[0] != 0) # <<<<<<<<<<<<<<
6593  * cdef tuple fields
6594  *
6595  */
6596  __pyx_v_little_endian = ((((char *)(&__pyx_v_endian_detector))[0]) != 0);
6597 
6598  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
6599  * cdef tuple fields
6600  *
6601  * for childname in descr.names: # <<<<<<<<<<<<<<
6602  * fields = descr.fields[childname]
6603  * child, new_offset = fields
6604  */
6605  if (unlikely(__pyx_v_descr->names == Py_None)) {
6606  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
6607  __PYX_ERR(3, 805, __pyx_L1_error)
6608  }
6609  __pyx_t_1 = __pyx_v_descr->names; __Pyx_INCREF(__pyx_t_1); __pyx_t_2 = 0;
6610  for (;;) {
6611  if (__pyx_t_2 >= PyTuple_GET_SIZE(__pyx_t_1)) break;
6612  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6613  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_1, __pyx_t_2); __Pyx_INCREF(__pyx_t_3); __pyx_t_2++; if (unlikely(0 < 0)) __PYX_ERR(3, 805, __pyx_L1_error)
6614  #else
6615  __pyx_t_3 = PySequence_ITEM(__pyx_t_1, __pyx_t_2); __pyx_t_2++; if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 805, __pyx_L1_error)
6616  __Pyx_GOTREF(__pyx_t_3);
6617  #endif
6618  __Pyx_XDECREF_SET(__pyx_v_childname, __pyx_t_3);
6619  __pyx_t_3 = 0;
6620 
6621  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":806
6622  *
6623  * for childname in descr.names:
6624  * fields = descr.fields[childname] # <<<<<<<<<<<<<<
6625  * child, new_offset = fields
6626  *
6627  */
6628  if (unlikely(__pyx_v_descr->fields == Py_None)) {
6629  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
6630  __PYX_ERR(3, 806, __pyx_L1_error)
6631  }
6632  __pyx_t_3 = __Pyx_PyDict_GetItem(__pyx_v_descr->fields, __pyx_v_childname); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 806, __pyx_L1_error)
6633  __Pyx_GOTREF(__pyx_t_3);
6634  if (!(likely(PyTuple_CheckExact(__pyx_t_3))||((__pyx_t_3) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_t_3)->tp_name), 0))) __PYX_ERR(3, 806, __pyx_L1_error)
6635  __Pyx_XDECREF_SET(__pyx_v_fields, ((PyObject*)__pyx_t_3));
6636  __pyx_t_3 = 0;
6637 
6638  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":807
6639  * for childname in descr.names:
6640  * fields = descr.fields[childname]
6641  * child, new_offset = fields # <<<<<<<<<<<<<<
6642  *
6643  * if (end - f) - <int>(new_offset - offset[0]) < 15:
6644  */
6645  if (likely(__pyx_v_fields != Py_None)) {
6646  PyObject* sequence = __pyx_v_fields;
6647  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
6648  if (unlikely(size != 2)) {
6649  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
6650  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
6651  __PYX_ERR(3, 807, __pyx_L1_error)
6652  }
6653  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
6654  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
6655  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
6656  __Pyx_INCREF(__pyx_t_3);
6657  __Pyx_INCREF(__pyx_t_4);
6658  #else
6659  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 807, __pyx_L1_error)
6660  __Pyx_GOTREF(__pyx_t_3);
6661  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 807, __pyx_L1_error)
6662  __Pyx_GOTREF(__pyx_t_4);
6663  #endif
6664  } else {
6665  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(3, 807, __pyx_L1_error)
6666  }
6667  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_ptype_5numpy_dtype))))) __PYX_ERR(3, 807, __pyx_L1_error)
6668  __Pyx_XDECREF_SET(__pyx_v_child, ((PyArray_Descr *)__pyx_t_3));
6669  __pyx_t_3 = 0;
6670  __Pyx_XDECREF_SET(__pyx_v_new_offset, __pyx_t_4);
6671  __pyx_t_4 = 0;
6672 
6673  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
6674  * child, new_offset = fields
6675  *
6676  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
6677  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6678  *
6679  */
6680  __pyx_t_4 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 809, __pyx_L1_error)
6681  __Pyx_GOTREF(__pyx_t_4);
6682  __pyx_t_3 = PyNumber_Subtract(__pyx_v_new_offset, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 809, __pyx_L1_error)
6683  __Pyx_GOTREF(__pyx_t_3);
6684  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6685  __pyx_t_5 = __Pyx_PyInt_As_int(__pyx_t_3); if (unlikely((__pyx_t_5 == (int)-1) && PyErr_Occurred())) __PYX_ERR(3, 809, __pyx_L1_error)
6686  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6687  __pyx_t_6 = ((((__pyx_v_end - __pyx_v_f) - ((int)__pyx_t_5)) < 15) != 0);
6688  if (unlikely(__pyx_t_6)) {
6689 
6690  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
6691  *
6692  * if (end - f) - <int>(new_offset - offset[0]) < 15:
6693  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
6694  *
6695  * if ((child.byteorder == c'>' and little_endian) or
6696  */
6697  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 810, __pyx_L1_error)
6698  __Pyx_GOTREF(__pyx_t_3);
6699  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6700  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6701  __PYX_ERR(3, 810, __pyx_L1_error)
6702 
6703  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":809
6704  * child, new_offset = fields
6705  *
6706  * if (end - f) - <int>(new_offset - offset[0]) < 15: # <<<<<<<<<<<<<<
6707  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6708  *
6709  */
6710  }
6711 
6712  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
6713  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6714  *
6715  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6716  * (child.byteorder == c'<' and not little_endian)):
6717  * raise ValueError(u"Non-native byte order not supported")
6718  */
6719  __pyx_t_7 = ((__pyx_v_child->byteorder == '>') != 0);
6720  if (!__pyx_t_7) {
6721  goto __pyx_L8_next_or;
6722  } else {
6723  }
6724  __pyx_t_7 = (__pyx_v_little_endian != 0);
6725  if (!__pyx_t_7) {
6726  } else {
6727  __pyx_t_6 = __pyx_t_7;
6728  goto __pyx_L7_bool_binop_done;
6729  }
6730  __pyx_L8_next_or:;
6731 
6732  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":813
6733  *
6734  * if ((child.byteorder == c'>' and little_endian) or
6735  * (child.byteorder == c'<' and not little_endian)): # <<<<<<<<<<<<<<
6736  * raise ValueError(u"Non-native byte order not supported")
6737  * # One could encode it in the format string and have Cython
6738  */
6739  __pyx_t_7 = ((__pyx_v_child->byteorder == '<') != 0);
6740  if (__pyx_t_7) {
6741  } else {
6742  __pyx_t_6 = __pyx_t_7;
6743  goto __pyx_L7_bool_binop_done;
6744  }
6745  __pyx_t_7 = ((!(__pyx_v_little_endian != 0)) != 0);
6746  __pyx_t_6 = __pyx_t_7;
6747  __pyx_L7_bool_binop_done:;
6748 
6749  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
6750  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6751  *
6752  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6753  * (child.byteorder == c'<' and not little_endian)):
6754  * raise ValueError(u"Non-native byte order not supported")
6755  */
6756  if (unlikely(__pyx_t_6)) {
6757 
6758  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
6759  * if ((child.byteorder == c'>' and little_endian) or
6760  * (child.byteorder == c'<' and not little_endian)):
6761  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
6762  * # One could encode it in the format string and have Cython
6763  * # complain instead, BUT: < and > in format strings also imply
6764  */
6765  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__7, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 814, __pyx_L1_error)
6766  __Pyx_GOTREF(__pyx_t_3);
6767  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
6768  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6769  __PYX_ERR(3, 814, __pyx_L1_error)
6770 
6771  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":812
6772  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd")
6773  *
6774  * if ((child.byteorder == c'>' and little_endian) or # <<<<<<<<<<<<<<
6775  * (child.byteorder == c'<' and not little_endian)):
6776  * raise ValueError(u"Non-native byte order not supported")
6777  */
6778  }
6779 
6780  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":824
6781  *
6782  * # Output padding bytes
6783  * while offset[0] < new_offset: # <<<<<<<<<<<<<<
6784  * f[0] = 120 # "x"; pad byte
6785  * f += 1
6786  */
6787  while (1) {
6788  __pyx_t_3 = __Pyx_PyInt_From_int((__pyx_v_offset[0])); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 824, __pyx_L1_error)
6789  __Pyx_GOTREF(__pyx_t_3);
6790  __pyx_t_4 = PyObject_RichCompare(__pyx_t_3, __pyx_v_new_offset, Py_LT); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 824, __pyx_L1_error)
6791  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6792  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 824, __pyx_L1_error)
6793  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6794  if (!__pyx_t_6) break;
6795 
6796  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":825
6797  * # Output padding bytes
6798  * while offset[0] < new_offset:
6799  * f[0] = 120 # "x"; pad byte # <<<<<<<<<<<<<<
6800  * f += 1
6801  * offset[0] += 1
6802  */
6803  (__pyx_v_f[0]) = 0x78;
6804 
6805  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":826
6806  * while offset[0] < new_offset:
6807  * f[0] = 120 # "x"; pad byte
6808  * f += 1 # <<<<<<<<<<<<<<
6809  * offset[0] += 1
6810  *
6811  */
6812  __pyx_v_f = (__pyx_v_f + 1);
6813 
6814  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":827
6815  * f[0] = 120 # "x"; pad byte
6816  * f += 1
6817  * offset[0] += 1 # <<<<<<<<<<<<<<
6818  *
6819  * offset[0] += child.itemsize
6820  */
6821  __pyx_t_8 = 0;
6822  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + 1);
6823  }
6824 
6825  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":829
6826  * offset[0] += 1
6827  *
6828  * offset[0] += child.itemsize # <<<<<<<<<<<<<<
6829  *
6830  * if not PyDataType_HASFIELDS(child):
6831  */
6832  __pyx_t_8 = 0;
6833  (__pyx_v_offset[__pyx_t_8]) = ((__pyx_v_offset[__pyx_t_8]) + __pyx_v_child->elsize);
6834 
6835  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
6836  * offset[0] += child.itemsize
6837  *
6838  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
6839  * t = child.type_num
6840  * if end - f < 5:
6841  */
6842  __pyx_t_6 = ((!(PyDataType_HASFIELDS(__pyx_v_child) != 0)) != 0);
6843  if (__pyx_t_6) {
6844 
6845  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":832
6846  *
6847  * if not PyDataType_HASFIELDS(child):
6848  * t = child.type_num # <<<<<<<<<<<<<<
6849  * if end - f < 5:
6850  * raise RuntimeError(u"Format string allocated too short.")
6851  */
6852  __pyx_t_4 = __Pyx_PyInt_From_int(__pyx_v_child->type_num); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 832, __pyx_L1_error)
6853  __Pyx_GOTREF(__pyx_t_4);
6854  __Pyx_XDECREF_SET(__pyx_v_t, __pyx_t_4);
6855  __pyx_t_4 = 0;
6856 
6857  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
6858  * if not PyDataType_HASFIELDS(child):
6859  * t = child.type_num
6860  * if end - f < 5: # <<<<<<<<<<<<<<
6861  * raise RuntimeError(u"Format string allocated too short.")
6862  *
6863  */
6864  __pyx_t_6 = (((__pyx_v_end - __pyx_v_f) < 5) != 0);
6865  if (unlikely(__pyx_t_6)) {
6866 
6867  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
6868  * t = child.type_num
6869  * if end - f < 5:
6870  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
6871  *
6872  * # Until ticket #99 is fixed, use integers to avoid warnings
6873  */
6874  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_builtin_RuntimeError, __pyx_tuple__8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 834, __pyx_L1_error)
6875  __Pyx_GOTREF(__pyx_t_4);
6876  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
6877  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6878  __PYX_ERR(3, 834, __pyx_L1_error)
6879 
6880  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":833
6881  * if not PyDataType_HASFIELDS(child):
6882  * t = child.type_num
6883  * if end - f < 5: # <<<<<<<<<<<<<<
6884  * raise RuntimeError(u"Format string allocated too short.")
6885  *
6886  */
6887  }
6888 
6889  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":837
6890  *
6891  * # Until ticket #99 is fixed, use integers to avoid warnings
6892  * if t == NPY_BYTE: f[0] = 98 #"b" # <<<<<<<<<<<<<<
6893  * elif t == NPY_UBYTE: f[0] = 66 #"B"
6894  * elif t == NPY_SHORT: f[0] = 104 #"h"
6895  */
6896  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_BYTE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 837, __pyx_L1_error)
6897  __Pyx_GOTREF(__pyx_t_4);
6898  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 837, __pyx_L1_error)
6899  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6900  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 837, __pyx_L1_error)
6901  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6902  if (__pyx_t_6) {
6903  (__pyx_v_f[0]) = 98;
6904  goto __pyx_L15;
6905  }
6906 
6907  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":838
6908  * # Until ticket #99 is fixed, use integers to avoid warnings
6909  * if t == NPY_BYTE: f[0] = 98 #"b"
6910  * elif t == NPY_UBYTE: f[0] = 66 #"B" # <<<<<<<<<<<<<<
6911  * elif t == NPY_SHORT: f[0] = 104 #"h"
6912  * elif t == NPY_USHORT: f[0] = 72 #"H"
6913  */
6914  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UBYTE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 838, __pyx_L1_error)
6915  __Pyx_GOTREF(__pyx_t_3);
6916  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 838, __pyx_L1_error)
6917  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6918  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 838, __pyx_L1_error)
6919  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6920  if (__pyx_t_6) {
6921  (__pyx_v_f[0]) = 66;
6922  goto __pyx_L15;
6923  }
6924 
6925  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":839
6926  * if t == NPY_BYTE: f[0] = 98 #"b"
6927  * elif t == NPY_UBYTE: f[0] = 66 #"B"
6928  * elif t == NPY_SHORT: f[0] = 104 #"h" # <<<<<<<<<<<<<<
6929  * elif t == NPY_USHORT: f[0] = 72 #"H"
6930  * elif t == NPY_INT: f[0] = 105 #"i"
6931  */
6932  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_SHORT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 839, __pyx_L1_error)
6933  __Pyx_GOTREF(__pyx_t_4);
6934  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 839, __pyx_L1_error)
6935  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6936  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 839, __pyx_L1_error)
6937  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6938  if (__pyx_t_6) {
6939  (__pyx_v_f[0]) = 0x68;
6940  goto __pyx_L15;
6941  }
6942 
6943  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":840
6944  * elif t == NPY_UBYTE: f[0] = 66 #"B"
6945  * elif t == NPY_SHORT: f[0] = 104 #"h"
6946  * elif t == NPY_USHORT: f[0] = 72 #"H" # <<<<<<<<<<<<<<
6947  * elif t == NPY_INT: f[0] = 105 #"i"
6948  * elif t == NPY_UINT: f[0] = 73 #"I"
6949  */
6950  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_USHORT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 840, __pyx_L1_error)
6951  __Pyx_GOTREF(__pyx_t_3);
6952  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 840, __pyx_L1_error)
6953  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6954  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 840, __pyx_L1_error)
6955  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6956  if (__pyx_t_6) {
6957  (__pyx_v_f[0]) = 72;
6958  goto __pyx_L15;
6959  }
6960 
6961  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":841
6962  * elif t == NPY_SHORT: f[0] = 104 #"h"
6963  * elif t == NPY_USHORT: f[0] = 72 #"H"
6964  * elif t == NPY_INT: f[0] = 105 #"i" # <<<<<<<<<<<<<<
6965  * elif t == NPY_UINT: f[0] = 73 #"I"
6966  * elif t == NPY_LONG: f[0] = 108 #"l"
6967  */
6968  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_INT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 841, __pyx_L1_error)
6969  __Pyx_GOTREF(__pyx_t_4);
6970  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 841, __pyx_L1_error)
6971  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6972  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 841, __pyx_L1_error)
6973  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6974  if (__pyx_t_6) {
6975  (__pyx_v_f[0]) = 0x69;
6976  goto __pyx_L15;
6977  }
6978 
6979  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":842
6980  * elif t == NPY_USHORT: f[0] = 72 #"H"
6981  * elif t == NPY_INT: f[0] = 105 #"i"
6982  * elif t == NPY_UINT: f[0] = 73 #"I" # <<<<<<<<<<<<<<
6983  * elif t == NPY_LONG: f[0] = 108 #"l"
6984  * elif t == NPY_ULONG: f[0] = 76 #"L"
6985  */
6986  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_UINT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 842, __pyx_L1_error)
6987  __Pyx_GOTREF(__pyx_t_3);
6988  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 842, __pyx_L1_error)
6989  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
6990  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 842, __pyx_L1_error)
6991  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
6992  if (__pyx_t_6) {
6993  (__pyx_v_f[0]) = 73;
6994  goto __pyx_L15;
6995  }
6996 
6997  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":843
6998  * elif t == NPY_INT: f[0] = 105 #"i"
6999  * elif t == NPY_UINT: f[0] = 73 #"I"
7000  * elif t == NPY_LONG: f[0] = 108 #"l" # <<<<<<<<<<<<<<
7001  * elif t == NPY_ULONG: f[0] = 76 #"L"
7002  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7003  */
7004  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 843, __pyx_L1_error)
7005  __Pyx_GOTREF(__pyx_t_4);
7006  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 843, __pyx_L1_error)
7007  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7008  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 843, __pyx_L1_error)
7009  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7010  if (__pyx_t_6) {
7011  (__pyx_v_f[0]) = 0x6C;
7012  goto __pyx_L15;
7013  }
7014 
7015  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":844
7016  * elif t == NPY_UINT: f[0] = 73 #"I"
7017  * elif t == NPY_LONG: f[0] = 108 #"l"
7018  * elif t == NPY_ULONG: f[0] = 76 #"L" # <<<<<<<<<<<<<<
7019  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7020  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7021  */
7022  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 844, __pyx_L1_error)
7023  __Pyx_GOTREF(__pyx_t_3);
7024  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 844, __pyx_L1_error)
7025  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7026  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 844, __pyx_L1_error)
7027  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7028  if (__pyx_t_6) {
7029  (__pyx_v_f[0]) = 76;
7030  goto __pyx_L15;
7031  }
7032 
7033  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":845
7034  * elif t == NPY_LONG: f[0] = 108 #"l"
7035  * elif t == NPY_ULONG: f[0] = 76 #"L"
7036  * elif t == NPY_LONGLONG: f[0] = 113 #"q" # <<<<<<<<<<<<<<
7037  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7038  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7039  */
7040  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGLONG); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 845, __pyx_L1_error)
7041  __Pyx_GOTREF(__pyx_t_4);
7042  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 845, __pyx_L1_error)
7043  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7044  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 845, __pyx_L1_error)
7045  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7046  if (__pyx_t_6) {
7047  (__pyx_v_f[0]) = 0x71;
7048  goto __pyx_L15;
7049  }
7050 
7051  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":846
7052  * elif t == NPY_ULONG: f[0] = 76 #"L"
7053  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7054  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q" # <<<<<<<<<<<<<<
7055  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7056  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7057  */
7058  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_ULONGLONG); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 846, __pyx_L1_error)
7059  __Pyx_GOTREF(__pyx_t_3);
7060  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 846, __pyx_L1_error)
7061  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7062  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 846, __pyx_L1_error)
7063  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7064  if (__pyx_t_6) {
7065  (__pyx_v_f[0]) = 81;
7066  goto __pyx_L15;
7067  }
7068 
7069  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":847
7070  * elif t == NPY_LONGLONG: f[0] = 113 #"q"
7071  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7072  * elif t == NPY_FLOAT: f[0] = 102 #"f" # <<<<<<<<<<<<<<
7073  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7074  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7075  */
7076  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_FLOAT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 847, __pyx_L1_error)
7077  __Pyx_GOTREF(__pyx_t_4);
7078  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 847, __pyx_L1_error)
7079  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7080  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 847, __pyx_L1_error)
7081  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7082  if (__pyx_t_6) {
7083  (__pyx_v_f[0]) = 0x66;
7084  goto __pyx_L15;
7085  }
7086 
7087  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":848
7088  * elif t == NPY_ULONGLONG: f[0] = 81 #"Q"
7089  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7090  * elif t == NPY_DOUBLE: f[0] = 100 #"d" # <<<<<<<<<<<<<<
7091  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7092  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7093  */
7094  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_DOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 848, __pyx_L1_error)
7095  __Pyx_GOTREF(__pyx_t_3);
7096  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 848, __pyx_L1_error)
7097  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7098  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 848, __pyx_L1_error)
7099  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7100  if (__pyx_t_6) {
7101  (__pyx_v_f[0]) = 0x64;
7102  goto __pyx_L15;
7103  }
7104 
7105  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":849
7106  * elif t == NPY_FLOAT: f[0] = 102 #"f"
7107  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7108  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g" # <<<<<<<<<<<<<<
7109  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7110  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7111  */
7112  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_LONGDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 849, __pyx_L1_error)
7113  __Pyx_GOTREF(__pyx_t_4);
7114  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 849, __pyx_L1_error)
7115  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7116  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 849, __pyx_L1_error)
7117  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7118  if (__pyx_t_6) {
7119  (__pyx_v_f[0]) = 0x67;
7120  goto __pyx_L15;
7121  }
7122 
7123  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":850
7124  * elif t == NPY_DOUBLE: f[0] = 100 #"d"
7125  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7126  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf # <<<<<<<<<<<<<<
7127  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7128  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7129  */
7130  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CFLOAT); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 850, __pyx_L1_error)
7131  __Pyx_GOTREF(__pyx_t_3);
7132  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 850, __pyx_L1_error)
7133  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7134  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 850, __pyx_L1_error)
7135  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7136  if (__pyx_t_6) {
7137  (__pyx_v_f[0]) = 90;
7138  (__pyx_v_f[1]) = 0x66;
7139  __pyx_v_f = (__pyx_v_f + 1);
7140  goto __pyx_L15;
7141  }
7142 
7143  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":851
7144  * elif t == NPY_LONGDOUBLE: f[0] = 103 #"g"
7145  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7146  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd # <<<<<<<<<<<<<<
7147  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7148  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7149  */
7150  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CDOUBLE); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 851, __pyx_L1_error)
7151  __Pyx_GOTREF(__pyx_t_4);
7152  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 851, __pyx_L1_error)
7153  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7154  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 851, __pyx_L1_error)
7155  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7156  if (__pyx_t_6) {
7157  (__pyx_v_f[0]) = 90;
7158  (__pyx_v_f[1]) = 0x64;
7159  __pyx_v_f = (__pyx_v_f + 1);
7160  goto __pyx_L15;
7161  }
7162 
7163  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":852
7164  * elif t == NPY_CFLOAT: f[0] = 90; f[1] = 102; f += 1 # Zf
7165  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7166  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg # <<<<<<<<<<<<<<
7167  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7168  * else:
7169  */
7170  __pyx_t_3 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_CLONGDOUBLE); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 852, __pyx_L1_error)
7171  __Pyx_GOTREF(__pyx_t_3);
7172  __pyx_t_4 = PyObject_RichCompare(__pyx_v_t, __pyx_t_3, Py_EQ); __Pyx_XGOTREF(__pyx_t_4); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 852, __pyx_L1_error)
7173  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7174  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_4); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 852, __pyx_L1_error)
7175  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7176  if (__pyx_t_6) {
7177  (__pyx_v_f[0]) = 90;
7178  (__pyx_v_f[1]) = 0x67;
7179  __pyx_v_f = (__pyx_v_f + 1);
7180  goto __pyx_L15;
7181  }
7182 
7183  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":853
7184  * elif t == NPY_CDOUBLE: f[0] = 90; f[1] = 100; f += 1 # Zd
7185  * elif t == NPY_CLONGDOUBLE: f[0] = 90; f[1] = 103; f += 1 # Zg
7186  * elif t == NPY_OBJECT: f[0] = 79 #"O" # <<<<<<<<<<<<<<
7187  * else:
7188  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7189  */
7190  __pyx_t_4 = __Pyx_PyInt_From_enum__NPY_TYPES(NPY_OBJECT); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 853, __pyx_L1_error)
7191  __Pyx_GOTREF(__pyx_t_4);
7192  __pyx_t_3 = PyObject_RichCompare(__pyx_v_t, __pyx_t_4, Py_EQ); __Pyx_XGOTREF(__pyx_t_3); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 853, __pyx_L1_error)
7193  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7194  __pyx_t_6 = __Pyx_PyObject_IsTrue(__pyx_t_3); if (unlikely(__pyx_t_6 < 0)) __PYX_ERR(3, 853, __pyx_L1_error)
7195  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7196  if (likely(__pyx_t_6)) {
7197  (__pyx_v_f[0]) = 79;
7198  goto __pyx_L15;
7199  }
7200 
7201  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":855
7202  * elif t == NPY_OBJECT: f[0] = 79 #"O"
7203  * else:
7204  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t) # <<<<<<<<<<<<<<
7205  * f += 1
7206  * else:
7207  */
7208  /*else*/ {
7209  __pyx_t_3 = PyUnicode_Format(__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_v_t); if (unlikely(!__pyx_t_3)) __PYX_ERR(3, 855, __pyx_L1_error)
7210  __Pyx_GOTREF(__pyx_t_3);
7211  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(3, 855, __pyx_L1_error)
7212  __Pyx_GOTREF(__pyx_t_4);
7213  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
7214  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
7215  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
7216  __PYX_ERR(3, 855, __pyx_L1_error)
7217  }
7218  __pyx_L15:;
7219 
7220  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":856
7221  * else:
7222  * raise ValueError(u"unknown dtype code in numpy.pxd (%d)" % t)
7223  * f += 1 # <<<<<<<<<<<<<<
7224  * else:
7225  * # Cython ignores struct boundary information ("T{...}"),
7226  */
7227  __pyx_v_f = (__pyx_v_f + 1);
7228 
7229  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":831
7230  * offset[0] += child.itemsize
7231  *
7232  * if not PyDataType_HASFIELDS(child): # <<<<<<<<<<<<<<
7233  * t = child.type_num
7234  * if end - f < 5:
7235  */
7236  goto __pyx_L13;
7237  }
7238 
7239  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":860
7240  * # Cython ignores struct boundary information ("T{...}"),
7241  * # so don't output it
7242  * f = _util_dtypestring(child, f, end, offset) # <<<<<<<<<<<<<<
7243  * return f
7244  *
7245  */
7246  /*else*/ {
7247  __pyx_t_9 = __pyx_f_5numpy__util_dtypestring(__pyx_v_child, __pyx_v_f, __pyx_v_end, __pyx_v_offset); if (unlikely(__pyx_t_9 == ((char *)NULL))) __PYX_ERR(3, 860, __pyx_L1_error)
7248  __pyx_v_f = __pyx_t_9;
7249  }
7250  __pyx_L13:;
7251 
7252  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":805
7253  * cdef tuple fields
7254  *
7255  * for childname in descr.names: # <<<<<<<<<<<<<<
7256  * fields = descr.fields[childname]
7257  * child, new_offset = fields
7258  */
7259  }
7260  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
7261 
7262  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":861
7263  * # so don't output it
7264  * f = _util_dtypestring(child, f, end, offset)
7265  * return f # <<<<<<<<<<<<<<
7266  *
7267  *
7268  */
7269  __pyx_r = __pyx_v_f;
7270  goto __pyx_L0;
7271 
7272  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":796
7273  * return ()
7274  *
7275  * cdef inline char* _util_dtypestring(dtype descr, char* f, char* end, int* offset) except NULL: # <<<<<<<<<<<<<<
7276  * # Recursive utility function used in __getbuffer__ to get format
7277  * # string. The new location in the format string is returned.
7278  */
7279 
7280  /* function exit code */
7281  __pyx_L1_error:;
7282  __Pyx_XDECREF(__pyx_t_1);
7283  __Pyx_XDECREF(__pyx_t_3);
7284  __Pyx_XDECREF(__pyx_t_4);
7285  __Pyx_AddTraceback("numpy._util_dtypestring", __pyx_clineno, __pyx_lineno, __pyx_filename);
7286  __pyx_r = NULL;
7287  __pyx_L0:;
7288  __Pyx_XDECREF((PyObject *)__pyx_v_child);
7289  __Pyx_XDECREF(__pyx_v_fields);
7290  __Pyx_XDECREF(__pyx_v_childname);
7291  __Pyx_XDECREF(__pyx_v_new_offset);
7292  __Pyx_XDECREF(__pyx_v_t);
7293  __Pyx_RefNannyFinishContext();
7294  return __pyx_r;
7295 }
7296 
7297 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
7298  *
7299  *
7300  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7301  * cdef PyObject* baseptr
7302  * if base is None:
7303  */
7304 
7305 static CYTHON_INLINE void __pyx_f_5numpy_set_array_base(PyArrayObject *__pyx_v_arr, PyObject *__pyx_v_base) {
7306  PyObject *__pyx_v_baseptr;
7307  __Pyx_RefNannyDeclarations
7308  int __pyx_t_1;
7309  int __pyx_t_2;
7310  __Pyx_RefNannySetupContext("set_array_base", 0);
7311 
7312  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
7313  * cdef inline void set_array_base(ndarray arr, object base):
7314  * cdef PyObject* baseptr
7315  * if base is None: # <<<<<<<<<<<<<<
7316  * baseptr = NULL
7317  * else:
7318  */
7319  __pyx_t_1 = (__pyx_v_base == Py_None);
7320  __pyx_t_2 = (__pyx_t_1 != 0);
7321  if (__pyx_t_2) {
7322 
7323  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":980
7324  * cdef PyObject* baseptr
7325  * if base is None:
7326  * baseptr = NULL # <<<<<<<<<<<<<<
7327  * else:
7328  * Py_INCREF(base) # important to do this before decref below!
7329  */
7330  __pyx_v_baseptr = NULL;
7331 
7332  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":979
7333  * cdef inline void set_array_base(ndarray arr, object base):
7334  * cdef PyObject* baseptr
7335  * if base is None: # <<<<<<<<<<<<<<
7336  * baseptr = NULL
7337  * else:
7338  */
7339  goto __pyx_L3;
7340  }
7341 
7342  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":982
7343  * baseptr = NULL
7344  * else:
7345  * Py_INCREF(base) # important to do this before decref below! # <<<<<<<<<<<<<<
7346  * baseptr = <PyObject*>base
7347  * Py_XDECREF(arr.base)
7348  */
7349  /*else*/ {
7350  Py_INCREF(__pyx_v_base);
7351 
7352  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":983
7353  * else:
7354  * Py_INCREF(base) # important to do this before decref below!
7355  * baseptr = <PyObject*>base # <<<<<<<<<<<<<<
7356  * Py_XDECREF(arr.base)
7357  * arr.base = baseptr
7358  */
7359  __pyx_v_baseptr = ((PyObject *)__pyx_v_base);
7360  }
7361  __pyx_L3:;
7362 
7363  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":984
7364  * Py_INCREF(base) # important to do this before decref below!
7365  * baseptr = <PyObject*>base
7366  * Py_XDECREF(arr.base) # <<<<<<<<<<<<<<
7367  * arr.base = baseptr
7368  *
7369  */
7370  Py_XDECREF(__pyx_v_arr->base);
7371 
7372  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":985
7373  * baseptr = <PyObject*>base
7374  * Py_XDECREF(arr.base)
7375  * arr.base = baseptr # <<<<<<<<<<<<<<
7376  *
7377  * cdef inline object get_array_base(ndarray arr):
7378  */
7379  __pyx_v_arr->base = __pyx_v_baseptr;
7380 
7381  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":977
7382  *
7383  *
7384  * cdef inline void set_array_base(ndarray arr, object base): # <<<<<<<<<<<<<<
7385  * cdef PyObject* baseptr
7386  * if base is None:
7387  */
7388 
7389  /* function exit code */
7390  __Pyx_RefNannyFinishContext();
7391 }
7392 
7393 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
7394  * arr.base = baseptr
7395  *
7396  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7397  * if arr.base is NULL:
7398  * return None
7399  */
7400 
7401 static CYTHON_INLINE PyObject *__pyx_f_5numpy_get_array_base(PyArrayObject *__pyx_v_arr) {
7402  PyObject *__pyx_r = NULL;
7403  __Pyx_RefNannyDeclarations
7404  int __pyx_t_1;
7405  __Pyx_RefNannySetupContext("get_array_base", 0);
7406 
7407  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
7408  *
7409  * cdef inline object get_array_base(ndarray arr):
7410  * if arr.base is NULL: # <<<<<<<<<<<<<<
7411  * return None
7412  * else:
7413  */
7414  __pyx_t_1 = ((__pyx_v_arr->base == NULL) != 0);
7415  if (__pyx_t_1) {
7416 
7417  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":989
7418  * cdef inline object get_array_base(ndarray arr):
7419  * if arr.base is NULL:
7420  * return None # <<<<<<<<<<<<<<
7421  * else:
7422  * return <object>arr.base
7423  */
7424  __Pyx_XDECREF(__pyx_r);
7425  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
7426  goto __pyx_L0;
7427 
7428  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":988
7429  *
7430  * cdef inline object get_array_base(ndarray arr):
7431  * if arr.base is NULL: # <<<<<<<<<<<<<<
7432  * return None
7433  * else:
7434  */
7435  }
7436 
7437  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":991
7438  * return None
7439  * else:
7440  * return <object>arr.base # <<<<<<<<<<<<<<
7441  *
7442  *
7443  */
7444  /*else*/ {
7445  __Pyx_XDECREF(__pyx_r);
7446  __Pyx_INCREF(((PyObject *)__pyx_v_arr->base));
7447  __pyx_r = ((PyObject *)__pyx_v_arr->base);
7448  goto __pyx_L0;
7449  }
7450 
7451  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":987
7452  * arr.base = baseptr
7453  *
7454  * cdef inline object get_array_base(ndarray arr): # <<<<<<<<<<<<<<
7455  * if arr.base is NULL:
7456  * return None
7457  */
7458 
7459  /* function exit code */
7460  __pyx_L0:;
7461  __Pyx_XGIVEREF(__pyx_r);
7462  __Pyx_RefNannyFinishContext();
7463  return __pyx_r;
7464 }
7465 
7466 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":996
7467  * # Versions of the import_* functions which are more suitable for
7468  * # Cython code.
7469  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7470  * try:
7471  * _import_array()
7472  */
7473 
7474 static CYTHON_INLINE int __pyx_f_5numpy_import_array(void) {
7475  int __pyx_r;
7476  __Pyx_RefNannyDeclarations
7477  PyObject *__pyx_t_1 = NULL;
7478  PyObject *__pyx_t_2 = NULL;
7479  PyObject *__pyx_t_3 = NULL;
7480  int __pyx_t_4;
7481  PyObject *__pyx_t_5 = NULL;
7482  PyObject *__pyx_t_6 = NULL;
7483  PyObject *__pyx_t_7 = NULL;
7484  PyObject *__pyx_t_8 = NULL;
7485  __Pyx_RefNannySetupContext("import_array", 0);
7486 
7487  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
7488  * # Cython code.
7489  * cdef inline int import_array() except -1:
7490  * try: # <<<<<<<<<<<<<<
7491  * _import_array()
7492  * except Exception:
7493  */
7494  {
7495  __Pyx_PyThreadState_declare
7496  __Pyx_PyThreadState_assign
7497  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7498  __Pyx_XGOTREF(__pyx_t_1);
7499  __Pyx_XGOTREF(__pyx_t_2);
7500  __Pyx_XGOTREF(__pyx_t_3);
7501  /*try:*/ {
7502 
7503  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":998
7504  * cdef inline int import_array() except -1:
7505  * try:
7506  * _import_array() # <<<<<<<<<<<<<<
7507  * except Exception:
7508  * raise ImportError("numpy.core.multiarray failed to import")
7509  */
7510  __pyx_t_4 = _import_array(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 998, __pyx_L3_error)
7511 
7512  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
7513  * # Cython code.
7514  * cdef inline int import_array() except -1:
7515  * try: # <<<<<<<<<<<<<<
7516  * _import_array()
7517  * except Exception:
7518  */
7519  }
7520  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7521  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7522  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7523  goto __pyx_L8_try_end;
7524  __pyx_L3_error:;
7525 
7526  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":999
7527  * try:
7528  * _import_array()
7529  * except Exception: # <<<<<<<<<<<<<<
7530  * raise ImportError("numpy.core.multiarray failed to import")
7531  *
7532  */
7533  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7534  if (__pyx_t_4) {
7535  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7536  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 999, __pyx_L5_except_error)
7537  __Pyx_GOTREF(__pyx_t_5);
7538  __Pyx_GOTREF(__pyx_t_6);
7539  __Pyx_GOTREF(__pyx_t_7);
7540 
7541  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
7542  * _import_array()
7543  * except Exception:
7544  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
7545  *
7546  * cdef inline int import_umath() except -1:
7547  */
7548  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__9, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1000, __pyx_L5_except_error)
7549  __Pyx_GOTREF(__pyx_t_8);
7550  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7551  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7552  __PYX_ERR(3, 1000, __pyx_L5_except_error)
7553  }
7554  goto __pyx_L5_except_error;
7555  __pyx_L5_except_error:;
7556 
7557  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":997
7558  * # Cython code.
7559  * cdef inline int import_array() except -1:
7560  * try: # <<<<<<<<<<<<<<
7561  * _import_array()
7562  * except Exception:
7563  */
7564  __Pyx_XGIVEREF(__pyx_t_1);
7565  __Pyx_XGIVEREF(__pyx_t_2);
7566  __Pyx_XGIVEREF(__pyx_t_3);
7567  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7568  goto __pyx_L1_error;
7569  __pyx_L8_try_end:;
7570  }
7571 
7572  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":996
7573  * # Versions of the import_* functions which are more suitable for
7574  * # Cython code.
7575  * cdef inline int import_array() except -1: # <<<<<<<<<<<<<<
7576  * try:
7577  * _import_array()
7578  */
7579 
7580  /* function exit code */
7581  __pyx_r = 0;
7582  goto __pyx_L0;
7583  __pyx_L1_error:;
7584  __Pyx_XDECREF(__pyx_t_5);
7585  __Pyx_XDECREF(__pyx_t_6);
7586  __Pyx_XDECREF(__pyx_t_7);
7587  __Pyx_XDECREF(__pyx_t_8);
7588  __Pyx_AddTraceback("numpy.import_array", __pyx_clineno, __pyx_lineno, __pyx_filename);
7589  __pyx_r = -1;
7590  __pyx_L0:;
7591  __Pyx_RefNannyFinishContext();
7592  return __pyx_r;
7593 }
7594 
7595 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1002
7596  * raise ImportError("numpy.core.multiarray failed to import")
7597  *
7598  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7599  * try:
7600  * _import_umath()
7601  */
7602 
7603 static CYTHON_INLINE int __pyx_f_5numpy_import_umath(void) {
7604  int __pyx_r;
7605  __Pyx_RefNannyDeclarations
7606  PyObject *__pyx_t_1 = NULL;
7607  PyObject *__pyx_t_2 = NULL;
7608  PyObject *__pyx_t_3 = NULL;
7609  int __pyx_t_4;
7610  PyObject *__pyx_t_5 = NULL;
7611  PyObject *__pyx_t_6 = NULL;
7612  PyObject *__pyx_t_7 = NULL;
7613  PyObject *__pyx_t_8 = NULL;
7614  __Pyx_RefNannySetupContext("import_umath", 0);
7615 
7616  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
7617  *
7618  * cdef inline int import_umath() except -1:
7619  * try: # <<<<<<<<<<<<<<
7620  * _import_umath()
7621  * except Exception:
7622  */
7623  {
7624  __Pyx_PyThreadState_declare
7625  __Pyx_PyThreadState_assign
7626  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7627  __Pyx_XGOTREF(__pyx_t_1);
7628  __Pyx_XGOTREF(__pyx_t_2);
7629  __Pyx_XGOTREF(__pyx_t_3);
7630  /*try:*/ {
7631 
7632  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1004
7633  * cdef inline int import_umath() except -1:
7634  * try:
7635  * _import_umath() # <<<<<<<<<<<<<<
7636  * except Exception:
7637  * raise ImportError("numpy.core.umath failed to import")
7638  */
7639  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1004, __pyx_L3_error)
7640 
7641  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
7642  *
7643  * cdef inline int import_umath() except -1:
7644  * try: # <<<<<<<<<<<<<<
7645  * _import_umath()
7646  * except Exception:
7647  */
7648  }
7649  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7650  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7651  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7652  goto __pyx_L8_try_end;
7653  __pyx_L3_error:;
7654 
7655  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1005
7656  * try:
7657  * _import_umath()
7658  * except Exception: # <<<<<<<<<<<<<<
7659  * raise ImportError("numpy.core.umath failed to import")
7660  *
7661  */
7662  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7663  if (__pyx_t_4) {
7664  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7665  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1005, __pyx_L5_except_error)
7666  __Pyx_GOTREF(__pyx_t_5);
7667  __Pyx_GOTREF(__pyx_t_6);
7668  __Pyx_GOTREF(__pyx_t_7);
7669 
7670  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1006
7671  * _import_umath()
7672  * except Exception:
7673  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7674  *
7675  * cdef inline int import_ufunc() except -1:
7676  */
7677  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__10, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1006, __pyx_L5_except_error)
7678  __Pyx_GOTREF(__pyx_t_8);
7679  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7680  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7681  __PYX_ERR(3, 1006, __pyx_L5_except_error)
7682  }
7683  goto __pyx_L5_except_error;
7684  __pyx_L5_except_error:;
7685 
7686  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1003
7687  *
7688  * cdef inline int import_umath() except -1:
7689  * try: # <<<<<<<<<<<<<<
7690  * _import_umath()
7691  * except Exception:
7692  */
7693  __Pyx_XGIVEREF(__pyx_t_1);
7694  __Pyx_XGIVEREF(__pyx_t_2);
7695  __Pyx_XGIVEREF(__pyx_t_3);
7696  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7697  goto __pyx_L1_error;
7698  __pyx_L8_try_end:;
7699  }
7700 
7701  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1002
7702  * raise ImportError("numpy.core.multiarray failed to import")
7703  *
7704  * cdef inline int import_umath() except -1: # <<<<<<<<<<<<<<
7705  * try:
7706  * _import_umath()
7707  */
7708 
7709  /* function exit code */
7710  __pyx_r = 0;
7711  goto __pyx_L0;
7712  __pyx_L1_error:;
7713  __Pyx_XDECREF(__pyx_t_5);
7714  __Pyx_XDECREF(__pyx_t_6);
7715  __Pyx_XDECREF(__pyx_t_7);
7716  __Pyx_XDECREF(__pyx_t_8);
7717  __Pyx_AddTraceback("numpy.import_umath", __pyx_clineno, __pyx_lineno, __pyx_filename);
7718  __pyx_r = -1;
7719  __pyx_L0:;
7720  __Pyx_RefNannyFinishContext();
7721  return __pyx_r;
7722 }
7723 
7724 /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1008
7725  * raise ImportError("numpy.core.umath failed to import")
7726  *
7727  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7728  * try:
7729  * _import_umath()
7730  */
7731 
7732 static CYTHON_INLINE int __pyx_f_5numpy_import_ufunc(void) {
7733  int __pyx_r;
7734  __Pyx_RefNannyDeclarations
7735  PyObject *__pyx_t_1 = NULL;
7736  PyObject *__pyx_t_2 = NULL;
7737  PyObject *__pyx_t_3 = NULL;
7738  int __pyx_t_4;
7739  PyObject *__pyx_t_5 = NULL;
7740  PyObject *__pyx_t_6 = NULL;
7741  PyObject *__pyx_t_7 = NULL;
7742  PyObject *__pyx_t_8 = NULL;
7743  __Pyx_RefNannySetupContext("import_ufunc", 0);
7744 
7745  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
7746  *
7747  * cdef inline int import_ufunc() except -1:
7748  * try: # <<<<<<<<<<<<<<
7749  * _import_umath()
7750  * except Exception:
7751  */
7752  {
7753  __Pyx_PyThreadState_declare
7754  __Pyx_PyThreadState_assign
7755  __Pyx_ExceptionSave(&__pyx_t_1, &__pyx_t_2, &__pyx_t_3);
7756  __Pyx_XGOTREF(__pyx_t_1);
7757  __Pyx_XGOTREF(__pyx_t_2);
7758  __Pyx_XGOTREF(__pyx_t_3);
7759  /*try:*/ {
7760 
7761  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1010
7762  * cdef inline int import_ufunc() except -1:
7763  * try:
7764  * _import_umath() # <<<<<<<<<<<<<<
7765  * except Exception:
7766  * raise ImportError("numpy.core.umath failed to import")
7767  */
7768  __pyx_t_4 = _import_umath(); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(3, 1010, __pyx_L3_error)
7769 
7770  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
7771  *
7772  * cdef inline int import_ufunc() except -1:
7773  * try: # <<<<<<<<<<<<<<
7774  * _import_umath()
7775  * except Exception:
7776  */
7777  }
7778  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
7779  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
7780  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
7781  goto __pyx_L8_try_end;
7782  __pyx_L3_error:;
7783 
7784  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1011
7785  * try:
7786  * _import_umath()
7787  * except Exception: # <<<<<<<<<<<<<<
7788  * raise ImportError("numpy.core.umath failed to import")
7789  */
7790  __pyx_t_4 = __Pyx_PyErr_ExceptionMatches(((PyObject *)(&((PyTypeObject*)PyExc_Exception)[0])));
7791  if (__pyx_t_4) {
7792  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7793  if (__Pyx_GetException(&__pyx_t_5, &__pyx_t_6, &__pyx_t_7) < 0) __PYX_ERR(3, 1011, __pyx_L5_except_error)
7794  __Pyx_GOTREF(__pyx_t_5);
7795  __Pyx_GOTREF(__pyx_t_6);
7796  __Pyx_GOTREF(__pyx_t_7);
7797 
7798  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1012
7799  * _import_umath()
7800  * except Exception:
7801  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
7802  */
7803  __pyx_t_8 = __Pyx_PyObject_Call(__pyx_builtin_ImportError, __pyx_tuple__11, NULL); if (unlikely(!__pyx_t_8)) __PYX_ERR(3, 1012, __pyx_L5_except_error)
7804  __Pyx_GOTREF(__pyx_t_8);
7805  __Pyx_Raise(__pyx_t_8, 0, 0, 0);
7806  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
7807  __PYX_ERR(3, 1012, __pyx_L5_except_error)
7808  }
7809  goto __pyx_L5_except_error;
7810  __pyx_L5_except_error:;
7811 
7812  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1009
7813  *
7814  * cdef inline int import_ufunc() except -1:
7815  * try: # <<<<<<<<<<<<<<
7816  * _import_umath()
7817  * except Exception:
7818  */
7819  __Pyx_XGIVEREF(__pyx_t_1);
7820  __Pyx_XGIVEREF(__pyx_t_2);
7821  __Pyx_XGIVEREF(__pyx_t_3);
7822  __Pyx_ExceptionReset(__pyx_t_1, __pyx_t_2, __pyx_t_3);
7823  goto __pyx_L1_error;
7824  __pyx_L8_try_end:;
7825  }
7826 
7827  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1008
7828  * raise ImportError("numpy.core.umath failed to import")
7829  *
7830  * cdef inline int import_ufunc() except -1: # <<<<<<<<<<<<<<
7831  * try:
7832  * _import_umath()
7833  */
7834 
7835  /* function exit code */
7836  __pyx_r = 0;
7837  goto __pyx_L0;
7838  __pyx_L1_error:;
7839  __Pyx_XDECREF(__pyx_t_5);
7840  __Pyx_XDECREF(__pyx_t_6);
7841  __Pyx_XDECREF(__pyx_t_7);
7842  __Pyx_XDECREF(__pyx_t_8);
7843  __Pyx_AddTraceback("numpy.import_ufunc", __pyx_clineno, __pyx_lineno, __pyx_filename);
7844  __pyx_r = -1;
7845  __pyx_L0:;
7846  __Pyx_RefNannyFinishContext();
7847  return __pyx_r;
7848 }
7849 
7850 /* "View.MemoryView":121
7851  * cdef bint dtype_is_object
7852  *
7853  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7854  * mode="c", bint allocate_buffer=True):
7855  *
7856  */
7857 
7858 /* Python wrapper */
7859 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
7860 static int __pyx_array___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
7861  PyObject *__pyx_v_shape = 0;
7862  Py_ssize_t __pyx_v_itemsize;
7863  PyObject *__pyx_v_format = 0;
7864  PyObject *__pyx_v_mode = 0;
7865  int __pyx_v_allocate_buffer;
7866  int __pyx_r;
7867  __Pyx_RefNannyDeclarations
7868  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
7869  {
7870  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_shape,&__pyx_n_s_itemsize,&__pyx_n_s_format,&__pyx_n_s_mode,&__pyx_n_s_allocate_buffer,0};
7871  PyObject* values[5] = {0,0,0,0,0};
7872  values[3] = ((PyObject *)__pyx_n_s_c);
7873  if (unlikely(__pyx_kwds)) {
7874  Py_ssize_t kw_args;
7875  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
7876  switch (pos_args) {
7877  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7878  CYTHON_FALLTHROUGH;
7879  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7880  CYTHON_FALLTHROUGH;
7881  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7882  CYTHON_FALLTHROUGH;
7883  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7884  CYTHON_FALLTHROUGH;
7885  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7886  CYTHON_FALLTHROUGH;
7887  case 0: break;
7888  default: goto __pyx_L5_argtuple_error;
7889  }
7890  kw_args = PyDict_Size(__pyx_kwds);
7891  switch (pos_args) {
7892  case 0:
7893  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_shape)) != 0)) kw_args--;
7894  else goto __pyx_L5_argtuple_error;
7895  CYTHON_FALLTHROUGH;
7896  case 1:
7897  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_itemsize)) != 0)) kw_args--;
7898  else {
7899  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 1); __PYX_ERR(0, 121, __pyx_L3_error)
7900  }
7901  CYTHON_FALLTHROUGH;
7902  case 2:
7903  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_format)) != 0)) kw_args--;
7904  else {
7905  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, 2); __PYX_ERR(0, 121, __pyx_L3_error)
7906  }
7907  CYTHON_FALLTHROUGH;
7908  case 3:
7909  if (kw_args > 0) {
7910  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_mode);
7911  if (value) { values[3] = value; kw_args--; }
7912  }
7913  CYTHON_FALLTHROUGH;
7914  case 4:
7915  if (kw_args > 0) {
7916  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_allocate_buffer);
7917  if (value) { values[4] = value; kw_args--; }
7918  }
7919  }
7920  if (unlikely(kw_args > 0)) {
7921  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 121, __pyx_L3_error)
7922  }
7923  } else {
7924  switch (PyTuple_GET_SIZE(__pyx_args)) {
7925  case 5: values[4] = PyTuple_GET_ITEM(__pyx_args, 4);
7926  CYTHON_FALLTHROUGH;
7927  case 4: values[3] = PyTuple_GET_ITEM(__pyx_args, 3);
7928  CYTHON_FALLTHROUGH;
7929  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
7930  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
7931  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
7932  break;
7933  default: goto __pyx_L5_argtuple_error;
7934  }
7935  }
7936  __pyx_v_shape = ((PyObject*)values[0]);
7937  __pyx_v_itemsize = __Pyx_PyIndex_AsSsize_t(values[1]); if (unlikely((__pyx_v_itemsize == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 121, __pyx_L3_error)
7938  __pyx_v_format = values[2];
7939  __pyx_v_mode = values[3];
7940  if (values[4]) {
7941  __pyx_v_allocate_buffer = __Pyx_PyObject_IsTrue(values[4]); if (unlikely((__pyx_v_allocate_buffer == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 122, __pyx_L3_error)
7942  } else {
7943 
7944  /* "View.MemoryView":122
7945  *
7946  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None,
7947  * mode="c", bint allocate_buffer=True): # <<<<<<<<<<<<<<
7948  *
7949  * cdef int idx
7950  */
7951  __pyx_v_allocate_buffer = ((int)1);
7952  }
7953  }
7954  goto __pyx_L4_argument_unpacking_done;
7955  __pyx_L5_argtuple_error:;
7956  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 3, 5, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 121, __pyx_L3_error)
7957  __pyx_L3_error:;
7958  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
7959  __Pyx_RefNannyFinishContext();
7960  return -1;
7961  __pyx_L4_argument_unpacking_done:;
7962  if (unlikely(!__Pyx_ArgTypeTest(((PyObject *)__pyx_v_shape), (&PyTuple_Type), 1, "shape", 1))) __PYX_ERR(0, 121, __pyx_L1_error)
7963  if (unlikely(((PyObject *)__pyx_v_format) == Py_None)) {
7964  PyErr_Format(PyExc_TypeError, "Argument '%.200s' must not be None", "format"); __PYX_ERR(0, 121, __pyx_L1_error)
7965  }
7966  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(((struct __pyx_array_obj *)__pyx_v_self), __pyx_v_shape, __pyx_v_itemsize, __pyx_v_format, __pyx_v_mode, __pyx_v_allocate_buffer);
7967 
7968  /* "View.MemoryView":121
7969  * cdef bint dtype_is_object
7970  *
7971  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
7972  * mode="c", bint allocate_buffer=True):
7973  *
7974  */
7975 
7976  /* function exit code */
7977  goto __pyx_L0;
7978  __pyx_L1_error:;
7979  __pyx_r = -1;
7980  __pyx_L0:;
7981  __Pyx_RefNannyFinishContext();
7982  return __pyx_r;
7983 }
7984 
7985 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array___cinit__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, PyObject *__pyx_v_format, PyObject *__pyx_v_mode, int __pyx_v_allocate_buffer) {
7986  int __pyx_v_idx;
7987  Py_ssize_t __pyx_v_i;
7988  Py_ssize_t __pyx_v_dim;
7989  PyObject **__pyx_v_p;
7990  char __pyx_v_order;
7991  int __pyx_r;
7992  __Pyx_RefNannyDeclarations
7993  Py_ssize_t __pyx_t_1;
7994  int __pyx_t_2;
7995  PyObject *__pyx_t_3 = NULL;
7996  int __pyx_t_4;
7997  PyObject *__pyx_t_5 = NULL;
7998  char *__pyx_t_6;
7999  int __pyx_t_7;
8000  Py_ssize_t __pyx_t_8;
8001  PyObject *__pyx_t_9 = NULL;
8002  PyObject *__pyx_t_10 = NULL;
8003  Py_ssize_t __pyx_t_11;
8004  __Pyx_RefNannySetupContext("__cinit__", 0);
8005  __Pyx_INCREF(__pyx_v_format);
8006 
8007  /* "View.MemoryView":128
8008  * cdef PyObject **p
8009  *
8010  * self.ndim = <int> len(shape) # <<<<<<<<<<<<<<
8011  * self.itemsize = itemsize
8012  *
8013  */
8014  if (unlikely(__pyx_v_shape == Py_None)) {
8015  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
8016  __PYX_ERR(0, 128, __pyx_L1_error)
8017  }
8018  __pyx_t_1 = PyTuple_GET_SIZE(__pyx_v_shape); if (unlikely(__pyx_t_1 == ((Py_ssize_t)-1))) __PYX_ERR(0, 128, __pyx_L1_error)
8019  __pyx_v_self->ndim = ((int)__pyx_t_1);
8020 
8021  /* "View.MemoryView":129
8022  *
8023  * self.ndim = <int> len(shape)
8024  * self.itemsize = itemsize # <<<<<<<<<<<<<<
8025  *
8026  * if not self.ndim:
8027  */
8028  __pyx_v_self->itemsize = __pyx_v_itemsize;
8029 
8030  /* "View.MemoryView":131
8031  * self.itemsize = itemsize
8032  *
8033  * if not self.ndim: # <<<<<<<<<<<<<<
8034  * raise ValueError("Empty shape tuple for cython.array")
8035  *
8036  */
8037  __pyx_t_2 = ((!(__pyx_v_self->ndim != 0)) != 0);
8038  if (unlikely(__pyx_t_2)) {
8039 
8040  /* "View.MemoryView":132
8041  *
8042  * if not self.ndim:
8043  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
8044  *
8045  * if itemsize <= 0:
8046  */
8047  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__12, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 132, __pyx_L1_error)
8048  __Pyx_GOTREF(__pyx_t_3);
8049  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8050  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8051  __PYX_ERR(0, 132, __pyx_L1_error)
8052 
8053  /* "View.MemoryView":131
8054  * self.itemsize = itemsize
8055  *
8056  * if not self.ndim: # <<<<<<<<<<<<<<
8057  * raise ValueError("Empty shape tuple for cython.array")
8058  *
8059  */
8060  }
8061 
8062  /* "View.MemoryView":134
8063  * raise ValueError("Empty shape tuple for cython.array")
8064  *
8065  * if itemsize <= 0: # <<<<<<<<<<<<<<
8066  * raise ValueError("itemsize <= 0 for cython.array")
8067  *
8068  */
8069  __pyx_t_2 = ((__pyx_v_itemsize <= 0) != 0);
8070  if (unlikely(__pyx_t_2)) {
8071 
8072  /* "View.MemoryView":135
8073  *
8074  * if itemsize <= 0:
8075  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
8076  *
8077  * if not isinstance(format, bytes):
8078  */
8079  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__13, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 135, __pyx_L1_error)
8080  __Pyx_GOTREF(__pyx_t_3);
8081  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8082  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8083  __PYX_ERR(0, 135, __pyx_L1_error)
8084 
8085  /* "View.MemoryView":134
8086  * raise ValueError("Empty shape tuple for cython.array")
8087  *
8088  * if itemsize <= 0: # <<<<<<<<<<<<<<
8089  * raise ValueError("itemsize <= 0 for cython.array")
8090  *
8091  */
8092  }
8093 
8094  /* "View.MemoryView":137
8095  * raise ValueError("itemsize <= 0 for cython.array")
8096  *
8097  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8098  * format = format.encode('ASCII')
8099  * self._format = format # keep a reference to the byte string
8100  */
8101  __pyx_t_2 = PyBytes_Check(__pyx_v_format);
8102  __pyx_t_4 = ((!(__pyx_t_2 != 0)) != 0);
8103  if (__pyx_t_4) {
8104 
8105  /* "View.MemoryView":138
8106  *
8107  * if not isinstance(format, bytes):
8108  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
8109  * self._format = format # keep a reference to the byte string
8110  * self.format = self._format
8111  */
8112  __pyx_t_3 = __Pyx_PyObject_GetAttrStr(__pyx_v_format, __pyx_n_s_encode); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 138, __pyx_L1_error)
8113  __Pyx_GOTREF(__pyx_t_3);
8114  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_tuple__14, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 138, __pyx_L1_error)
8115  __Pyx_GOTREF(__pyx_t_5);
8116  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8117  __Pyx_DECREF_SET(__pyx_v_format, __pyx_t_5);
8118  __pyx_t_5 = 0;
8119 
8120  /* "View.MemoryView":137
8121  * raise ValueError("itemsize <= 0 for cython.array")
8122  *
8123  * if not isinstance(format, bytes): # <<<<<<<<<<<<<<
8124  * format = format.encode('ASCII')
8125  * self._format = format # keep a reference to the byte string
8126  */
8127  }
8128 
8129  /* "View.MemoryView":139
8130  * if not isinstance(format, bytes):
8131  * format = format.encode('ASCII')
8132  * self._format = format # keep a reference to the byte string # <<<<<<<<<<<<<<
8133  * self.format = self._format
8134  *
8135  */
8136  if (!(likely(PyBytes_CheckExact(__pyx_v_format))||((__pyx_v_format) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_v_format)->tp_name), 0))) __PYX_ERR(0, 139, __pyx_L1_error)
8137  __pyx_t_5 = __pyx_v_format;
8138  __Pyx_INCREF(__pyx_t_5);
8139  __Pyx_GIVEREF(__pyx_t_5);
8140  __Pyx_GOTREF(__pyx_v_self->_format);
8141  __Pyx_DECREF(__pyx_v_self->_format);
8142  __pyx_v_self->_format = ((PyObject*)__pyx_t_5);
8143  __pyx_t_5 = 0;
8144 
8145  /* "View.MemoryView":140
8146  * format = format.encode('ASCII')
8147  * self._format = format # keep a reference to the byte string
8148  * self.format = self._format # <<<<<<<<<<<<<<
8149  *
8150  *
8151  */
8152  if (unlikely(__pyx_v_self->_format == Py_None)) {
8153  PyErr_SetString(PyExc_TypeError, "expected bytes, NoneType found");
8154  __PYX_ERR(0, 140, __pyx_L1_error)
8155  }
8156  __pyx_t_6 = __Pyx_PyBytes_AsWritableString(__pyx_v_self->_format); if (unlikely((!__pyx_t_6) && PyErr_Occurred())) __PYX_ERR(0, 140, __pyx_L1_error)
8157  __pyx_v_self->format = __pyx_t_6;
8158 
8159  /* "View.MemoryView":143
8160  *
8161  *
8162  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2) # <<<<<<<<<<<<<<
8163  * self._strides = self._shape + self.ndim
8164  *
8165  */
8166  __pyx_v_self->_shape = ((Py_ssize_t *)PyObject_Malloc((((sizeof(Py_ssize_t)) * __pyx_v_self->ndim) * 2)));
8167 
8168  /* "View.MemoryView":144
8169  *
8170  * self._shape = <Py_ssize_t *> PyObject_Malloc(sizeof(Py_ssize_t)*self.ndim*2)
8171  * self._strides = self._shape + self.ndim # <<<<<<<<<<<<<<
8172  *
8173  * if not self._shape:
8174  */
8175  __pyx_v_self->_strides = (__pyx_v_self->_shape + __pyx_v_self->ndim);
8176 
8177  /* "View.MemoryView":146
8178  * self._strides = self._shape + self.ndim
8179  *
8180  * if not self._shape: # <<<<<<<<<<<<<<
8181  * raise MemoryError("unable to allocate shape and strides.")
8182  *
8183  */
8184  __pyx_t_4 = ((!(__pyx_v_self->_shape != 0)) != 0);
8185  if (unlikely(__pyx_t_4)) {
8186 
8187  /* "View.MemoryView":147
8188  *
8189  * if not self._shape:
8190  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
8191  *
8192  *
8193  */
8194  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__15, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 147, __pyx_L1_error)
8195  __Pyx_GOTREF(__pyx_t_5);
8196  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
8197  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8198  __PYX_ERR(0, 147, __pyx_L1_error)
8199 
8200  /* "View.MemoryView":146
8201  * self._strides = self._shape + self.ndim
8202  *
8203  * if not self._shape: # <<<<<<<<<<<<<<
8204  * raise MemoryError("unable to allocate shape and strides.")
8205  *
8206  */
8207  }
8208 
8209  /* "View.MemoryView":150
8210  *
8211  *
8212  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8213  * if dim <= 0:
8214  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8215  */
8216  __pyx_t_7 = 0;
8217  __pyx_t_5 = __pyx_v_shape; __Pyx_INCREF(__pyx_t_5); __pyx_t_1 = 0;
8218  for (;;) {
8219  if (__pyx_t_1 >= PyTuple_GET_SIZE(__pyx_t_5)) break;
8220  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
8221  __pyx_t_3 = PyTuple_GET_ITEM(__pyx_t_5, __pyx_t_1); __Pyx_INCREF(__pyx_t_3); __pyx_t_1++; if (unlikely(0 < 0)) __PYX_ERR(0, 150, __pyx_L1_error)
8222  #else
8223  __pyx_t_3 = PySequence_ITEM(__pyx_t_5, __pyx_t_1); __pyx_t_1++; if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 150, __pyx_L1_error)
8224  __Pyx_GOTREF(__pyx_t_3);
8225  #endif
8226  __pyx_t_8 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_8 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 150, __pyx_L1_error)
8227  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8228  __pyx_v_dim = __pyx_t_8;
8229  __pyx_v_idx = __pyx_t_7;
8230  __pyx_t_7 = (__pyx_t_7 + 1);
8231 
8232  /* "View.MemoryView":151
8233  *
8234  * for idx, dim in enumerate(shape):
8235  * if dim <= 0: # <<<<<<<<<<<<<<
8236  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8237  * self._shape[idx] = dim
8238  */
8239  __pyx_t_4 = ((__pyx_v_dim <= 0) != 0);
8240  if (unlikely(__pyx_t_4)) {
8241 
8242  /* "View.MemoryView":152
8243  * for idx, dim in enumerate(shape):
8244  * if dim <= 0:
8245  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim)) # <<<<<<<<<<<<<<
8246  * self._shape[idx] = dim
8247  *
8248  */
8249  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_idx); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 152, __pyx_L1_error)
8250  __Pyx_GOTREF(__pyx_t_3);
8251  __pyx_t_9 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error)
8252  __Pyx_GOTREF(__pyx_t_9);
8253  __pyx_t_10 = PyTuple_New(2); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error)
8254  __Pyx_GOTREF(__pyx_t_10);
8255  __Pyx_GIVEREF(__pyx_t_3);
8256  PyTuple_SET_ITEM(__pyx_t_10, 0, __pyx_t_3);
8257  __Pyx_GIVEREF(__pyx_t_9);
8258  PyTuple_SET_ITEM(__pyx_t_10, 1, __pyx_t_9);
8259  __pyx_t_3 = 0;
8260  __pyx_t_9 = 0;
8261  __pyx_t_9 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_t_10); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 152, __pyx_L1_error)
8262  __Pyx_GOTREF(__pyx_t_9);
8263  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8264  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_9); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 152, __pyx_L1_error)
8265  __Pyx_GOTREF(__pyx_t_10);
8266  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
8267  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8268  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8269  __PYX_ERR(0, 152, __pyx_L1_error)
8270 
8271  /* "View.MemoryView":151
8272  *
8273  * for idx, dim in enumerate(shape):
8274  * if dim <= 0: # <<<<<<<<<<<<<<
8275  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8276  * self._shape[idx] = dim
8277  */
8278  }
8279 
8280  /* "View.MemoryView":153
8281  * if dim <= 0:
8282  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8283  * self._shape[idx] = dim # <<<<<<<<<<<<<<
8284  *
8285  * cdef char order
8286  */
8287  (__pyx_v_self->_shape[__pyx_v_idx]) = __pyx_v_dim;
8288 
8289  /* "View.MemoryView":150
8290  *
8291  *
8292  * for idx, dim in enumerate(shape): # <<<<<<<<<<<<<<
8293  * if dim <= 0:
8294  * raise ValueError("Invalid shape in axis %d: %d." % (idx, dim))
8295  */
8296  }
8297  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8298 
8299  /* "View.MemoryView":156
8300  *
8301  * cdef char order
8302  * if mode == 'fortran': # <<<<<<<<<<<<<<
8303  * order = b'F'
8304  * self.mode = u'fortran'
8305  */
8306  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_fortran, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 156, __pyx_L1_error)
8307  if (__pyx_t_4) {
8308 
8309  /* "View.MemoryView":157
8310  * cdef char order
8311  * if mode == 'fortran':
8312  * order = b'F' # <<<<<<<<<<<<<<
8313  * self.mode = u'fortran'
8314  * elif mode == 'c':
8315  */
8316  __pyx_v_order = 'F';
8317 
8318  /* "View.MemoryView":158
8319  * if mode == 'fortran':
8320  * order = b'F'
8321  * self.mode = u'fortran' # <<<<<<<<<<<<<<
8322  * elif mode == 'c':
8323  * order = b'C'
8324  */
8325  __Pyx_INCREF(__pyx_n_u_fortran);
8326  __Pyx_GIVEREF(__pyx_n_u_fortran);
8327  __Pyx_GOTREF(__pyx_v_self->mode);
8328  __Pyx_DECREF(__pyx_v_self->mode);
8329  __pyx_v_self->mode = __pyx_n_u_fortran;
8330 
8331  /* "View.MemoryView":156
8332  *
8333  * cdef char order
8334  * if mode == 'fortran': # <<<<<<<<<<<<<<
8335  * order = b'F'
8336  * self.mode = u'fortran'
8337  */
8338  goto __pyx_L10;
8339  }
8340 
8341  /* "View.MemoryView":159
8342  * order = b'F'
8343  * self.mode = u'fortran'
8344  * elif mode == 'c': # <<<<<<<<<<<<<<
8345  * order = b'C'
8346  * self.mode = u'c'
8347  */
8348  __pyx_t_4 = (__Pyx_PyString_Equals(__pyx_v_mode, __pyx_n_s_c, Py_EQ)); if (unlikely(__pyx_t_4 < 0)) __PYX_ERR(0, 159, __pyx_L1_error)
8349  if (likely(__pyx_t_4)) {
8350 
8351  /* "View.MemoryView":160
8352  * self.mode = u'fortran'
8353  * elif mode == 'c':
8354  * order = b'C' # <<<<<<<<<<<<<<
8355  * self.mode = u'c'
8356  * else:
8357  */
8358  __pyx_v_order = 'C';
8359 
8360  /* "View.MemoryView":161
8361  * elif mode == 'c':
8362  * order = b'C'
8363  * self.mode = u'c' # <<<<<<<<<<<<<<
8364  * else:
8365  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8366  */
8367  __Pyx_INCREF(__pyx_n_u_c);
8368  __Pyx_GIVEREF(__pyx_n_u_c);
8369  __Pyx_GOTREF(__pyx_v_self->mode);
8370  __Pyx_DECREF(__pyx_v_self->mode);
8371  __pyx_v_self->mode = __pyx_n_u_c;
8372 
8373  /* "View.MemoryView":159
8374  * order = b'F'
8375  * self.mode = u'fortran'
8376  * elif mode == 'c': # <<<<<<<<<<<<<<
8377  * order = b'C'
8378  * self.mode = u'c'
8379  */
8380  goto __pyx_L10;
8381  }
8382 
8383  /* "View.MemoryView":163
8384  * self.mode = u'c'
8385  * else:
8386  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode) # <<<<<<<<<<<<<<
8387  *
8388  * self.len = fill_contig_strides_array(self._shape, self._strides,
8389  */
8390  /*else*/ {
8391  __pyx_t_5 = __Pyx_PyString_Format(__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_v_mode); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 163, __pyx_L1_error)
8392  __Pyx_GOTREF(__pyx_t_5);
8393  __pyx_t_10 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_5); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 163, __pyx_L1_error)
8394  __Pyx_GOTREF(__pyx_t_10);
8395  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
8396  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8397  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8398  __PYX_ERR(0, 163, __pyx_L1_error)
8399  }
8400  __pyx_L10:;
8401 
8402  /* "View.MemoryView":165
8403  * raise ValueError("Invalid mode, expected 'c' or 'fortran', got %s" % mode)
8404  *
8405  * self.len = fill_contig_strides_array(self._shape, self._strides, # <<<<<<<<<<<<<<
8406  * itemsize, self.ndim, order)
8407  *
8408  */
8409  __pyx_v_self->len = __pyx_fill_contig_strides_array(__pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_itemsize, __pyx_v_self->ndim, __pyx_v_order);
8410 
8411  /* "View.MemoryView":168
8412  * itemsize, self.ndim, order)
8413  *
8414  * self.free_data = allocate_buffer # <<<<<<<<<<<<<<
8415  * self.dtype_is_object = format == b'O'
8416  * if allocate_buffer:
8417  */
8418  __pyx_v_self->free_data = __pyx_v_allocate_buffer;
8419 
8420  /* "View.MemoryView":169
8421  *
8422  * self.free_data = allocate_buffer
8423  * self.dtype_is_object = format == b'O' # <<<<<<<<<<<<<<
8424  * if allocate_buffer:
8425  *
8426  */
8427  __pyx_t_10 = PyObject_RichCompare(__pyx_v_format, __pyx_n_b_O, Py_EQ); __Pyx_XGOTREF(__pyx_t_10); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 169, __pyx_L1_error)
8428  __pyx_t_4 = __Pyx_PyObject_IsTrue(__pyx_t_10); if (unlikely((__pyx_t_4 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 169, __pyx_L1_error)
8429  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8430  __pyx_v_self->dtype_is_object = __pyx_t_4;
8431 
8432  /* "View.MemoryView":170
8433  * self.free_data = allocate_buffer
8434  * self.dtype_is_object = format == b'O'
8435  * if allocate_buffer: # <<<<<<<<<<<<<<
8436  *
8437  *
8438  */
8439  __pyx_t_4 = (__pyx_v_allocate_buffer != 0);
8440  if (__pyx_t_4) {
8441 
8442  /* "View.MemoryView":173
8443  *
8444  *
8445  * self.data = <char *>malloc(self.len) # <<<<<<<<<<<<<<
8446  * if not self.data:
8447  * raise MemoryError("unable to allocate array data.")
8448  */
8449  __pyx_v_self->data = ((char *)malloc(__pyx_v_self->len));
8450 
8451  /* "View.MemoryView":174
8452  *
8453  * self.data = <char *>malloc(self.len)
8454  * if not self.data: # <<<<<<<<<<<<<<
8455  * raise MemoryError("unable to allocate array data.")
8456  *
8457  */
8458  __pyx_t_4 = ((!(__pyx_v_self->data != 0)) != 0);
8459  if (unlikely(__pyx_t_4)) {
8460 
8461  /* "View.MemoryView":175
8462  * self.data = <char *>malloc(self.len)
8463  * if not self.data:
8464  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
8465  *
8466  * if self.dtype_is_object:
8467  */
8468  __pyx_t_10 = __Pyx_PyObject_Call(__pyx_builtin_MemoryError, __pyx_tuple__16, NULL); if (unlikely(!__pyx_t_10)) __PYX_ERR(0, 175, __pyx_L1_error)
8469  __Pyx_GOTREF(__pyx_t_10);
8470  __Pyx_Raise(__pyx_t_10, 0, 0, 0);
8471  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
8472  __PYX_ERR(0, 175, __pyx_L1_error)
8473 
8474  /* "View.MemoryView":174
8475  *
8476  * self.data = <char *>malloc(self.len)
8477  * if not self.data: # <<<<<<<<<<<<<<
8478  * raise MemoryError("unable to allocate array data.")
8479  *
8480  */
8481  }
8482 
8483  /* "View.MemoryView":177
8484  * raise MemoryError("unable to allocate array data.")
8485  *
8486  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8487  * p = <PyObject **> self.data
8488  * for i in range(self.len / itemsize):
8489  */
8490  __pyx_t_4 = (__pyx_v_self->dtype_is_object != 0);
8491  if (__pyx_t_4) {
8492 
8493  /* "View.MemoryView":178
8494  *
8495  * if self.dtype_is_object:
8496  * p = <PyObject **> self.data # <<<<<<<<<<<<<<
8497  * for i in range(self.len / itemsize):
8498  * p[i] = Py_None
8499  */
8500  __pyx_v_p = ((PyObject **)__pyx_v_self->data);
8501 
8502  /* "View.MemoryView":179
8503  * if self.dtype_is_object:
8504  * p = <PyObject **> self.data
8505  * for i in range(self.len / itemsize): # <<<<<<<<<<<<<<
8506  * p[i] = Py_None
8507  * Py_INCREF(Py_None)
8508  */
8509  if (unlikely(__pyx_v_itemsize == 0)) {
8510  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
8511  __PYX_ERR(0, 179, __pyx_L1_error)
8512  }
8513  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_self->len))) {
8514  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
8515  __PYX_ERR(0, 179, __pyx_L1_error)
8516  }
8517  __pyx_t_1 = __Pyx_div_Py_ssize_t(__pyx_v_self->len, __pyx_v_itemsize);
8518  __pyx_t_8 = __pyx_t_1;
8519  for (__pyx_t_11 = 0; __pyx_t_11 < __pyx_t_8; __pyx_t_11+=1) {
8520  __pyx_v_i = __pyx_t_11;
8521 
8522  /* "View.MemoryView":180
8523  * p = <PyObject **> self.data
8524  * for i in range(self.len / itemsize):
8525  * p[i] = Py_None # <<<<<<<<<<<<<<
8526  * Py_INCREF(Py_None)
8527  *
8528  */
8529  (__pyx_v_p[__pyx_v_i]) = Py_None;
8530 
8531  /* "View.MemoryView":181
8532  * for i in range(self.len / itemsize):
8533  * p[i] = Py_None
8534  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
8535  *
8536  * @cname('getbuffer')
8537  */
8538  Py_INCREF(Py_None);
8539  }
8540 
8541  /* "View.MemoryView":177
8542  * raise MemoryError("unable to allocate array data.")
8543  *
8544  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8545  * p = <PyObject **> self.data
8546  * for i in range(self.len / itemsize):
8547  */
8548  }
8549 
8550  /* "View.MemoryView":170
8551  * self.free_data = allocate_buffer
8552  * self.dtype_is_object = format == b'O'
8553  * if allocate_buffer: # <<<<<<<<<<<<<<
8554  *
8555  *
8556  */
8557  }
8558 
8559  /* "View.MemoryView":121
8560  * cdef bint dtype_is_object
8561  *
8562  * def __cinit__(array self, tuple shape, Py_ssize_t itemsize, format not None, # <<<<<<<<<<<<<<
8563  * mode="c", bint allocate_buffer=True):
8564  *
8565  */
8566 
8567  /* function exit code */
8568  __pyx_r = 0;
8569  goto __pyx_L0;
8570  __pyx_L1_error:;
8571  __Pyx_XDECREF(__pyx_t_3);
8572  __Pyx_XDECREF(__pyx_t_5);
8573  __Pyx_XDECREF(__pyx_t_9);
8574  __Pyx_XDECREF(__pyx_t_10);
8575  __Pyx_AddTraceback("View.MemoryView.array.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8576  __pyx_r = -1;
8577  __pyx_L0:;
8578  __Pyx_XDECREF(__pyx_v_format);
8579  __Pyx_RefNannyFinishContext();
8580  return __pyx_r;
8581 }
8582 
8583 /* "View.MemoryView":184
8584  *
8585  * @cname('getbuffer')
8586  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8587  * cdef int bufmode = -1
8588  * if self.mode == u"c":
8589  */
8590 
8591 /* Python wrapper */
8592 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
8593 static CYTHON_UNUSED int __pyx_array_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8594  int __pyx_r;
8595  __Pyx_RefNannyDeclarations
8596  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
8597  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(((struct __pyx_array_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
8598 
8599  /* function exit code */
8600  __Pyx_RefNannyFinishContext();
8601  return __pyx_r;
8602 }
8603 
8604 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_2__getbuffer__(struct __pyx_array_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
8605  int __pyx_v_bufmode;
8606  int __pyx_r;
8607  __Pyx_RefNannyDeclarations
8608  int __pyx_t_1;
8609  int __pyx_t_2;
8610  PyObject *__pyx_t_3 = NULL;
8611  char *__pyx_t_4;
8612  Py_ssize_t __pyx_t_5;
8613  int __pyx_t_6;
8614  Py_ssize_t *__pyx_t_7;
8615  if (__pyx_v_info == NULL) {
8616  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
8617  return -1;
8618  }
8619  __Pyx_RefNannySetupContext("__getbuffer__", 0);
8620  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
8621  __Pyx_GIVEREF(__pyx_v_info->obj);
8622 
8623  /* "View.MemoryView":185
8624  * @cname('getbuffer')
8625  * def __getbuffer__(self, Py_buffer *info, int flags):
8626  * cdef int bufmode = -1 # <<<<<<<<<<<<<<
8627  * if self.mode == u"c":
8628  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8629  */
8630  __pyx_v_bufmode = -1;
8631 
8632  /* "View.MemoryView":186
8633  * def __getbuffer__(self, Py_buffer *info, int flags):
8634  * cdef int bufmode = -1
8635  * if self.mode == u"c": # <<<<<<<<<<<<<<
8636  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8637  * elif self.mode == u"fortran":
8638  */
8639  __pyx_t_1 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_c, Py_EQ)); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 186, __pyx_L1_error)
8640  __pyx_t_2 = (__pyx_t_1 != 0);
8641  if (__pyx_t_2) {
8642 
8643  /* "View.MemoryView":187
8644  * cdef int bufmode = -1
8645  * if self.mode == u"c":
8646  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8647  * elif self.mode == u"fortran":
8648  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8649  */
8650  __pyx_v_bufmode = (PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8651 
8652  /* "View.MemoryView":186
8653  * def __getbuffer__(self, Py_buffer *info, int flags):
8654  * cdef int bufmode = -1
8655  * if self.mode == u"c": # <<<<<<<<<<<<<<
8656  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8657  * elif self.mode == u"fortran":
8658  */
8659  goto __pyx_L3;
8660  }
8661 
8662  /* "View.MemoryView":188
8663  * if self.mode == u"c":
8664  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8665  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8666  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8667  * if not (flags & bufmode):
8668  */
8669  __pyx_t_2 = (__Pyx_PyUnicode_Equals(__pyx_v_self->mode, __pyx_n_u_fortran, Py_EQ)); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 188, __pyx_L1_error)
8670  __pyx_t_1 = (__pyx_t_2 != 0);
8671  if (__pyx_t_1) {
8672 
8673  /* "View.MemoryView":189
8674  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8675  * elif self.mode == u"fortran":
8676  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS # <<<<<<<<<<<<<<
8677  * if not (flags & bufmode):
8678  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8679  */
8680  __pyx_v_bufmode = (PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS);
8681 
8682  /* "View.MemoryView":188
8683  * if self.mode == u"c":
8684  * bufmode = PyBUF_C_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8685  * elif self.mode == u"fortran": # <<<<<<<<<<<<<<
8686  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8687  * if not (flags & bufmode):
8688  */
8689  }
8690  __pyx_L3:;
8691 
8692  /* "View.MemoryView":190
8693  * elif self.mode == u"fortran":
8694  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8695  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8696  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8697  * info.buf = self.data
8698  */
8699  __pyx_t_1 = ((!((__pyx_v_flags & __pyx_v_bufmode) != 0)) != 0);
8700  if (unlikely(__pyx_t_1)) {
8701 
8702  /* "View.MemoryView":191
8703  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8704  * if not (flags & bufmode):
8705  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
8706  * info.buf = self.data
8707  * info.len = self.len
8708  */
8709  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__17, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 191, __pyx_L1_error)
8710  __Pyx_GOTREF(__pyx_t_3);
8711  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
8712  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
8713  __PYX_ERR(0, 191, __pyx_L1_error)
8714 
8715  /* "View.MemoryView":190
8716  * elif self.mode == u"fortran":
8717  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
8718  * if not (flags & bufmode): # <<<<<<<<<<<<<<
8719  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8720  * info.buf = self.data
8721  */
8722  }
8723 
8724  /* "View.MemoryView":192
8725  * if not (flags & bufmode):
8726  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8727  * info.buf = self.data # <<<<<<<<<<<<<<
8728  * info.len = self.len
8729  * info.ndim = self.ndim
8730  */
8731  __pyx_t_4 = __pyx_v_self->data;
8732  __pyx_v_info->buf = __pyx_t_4;
8733 
8734  /* "View.MemoryView":193
8735  * raise ValueError("Can only create a buffer that is contiguous in memory.")
8736  * info.buf = self.data
8737  * info.len = self.len # <<<<<<<<<<<<<<
8738  * info.ndim = self.ndim
8739  * info.shape = self._shape
8740  */
8741  __pyx_t_5 = __pyx_v_self->len;
8742  __pyx_v_info->len = __pyx_t_5;
8743 
8744  /* "View.MemoryView":194
8745  * info.buf = self.data
8746  * info.len = self.len
8747  * info.ndim = self.ndim # <<<<<<<<<<<<<<
8748  * info.shape = self._shape
8749  * info.strides = self._strides
8750  */
8751  __pyx_t_6 = __pyx_v_self->ndim;
8752  __pyx_v_info->ndim = __pyx_t_6;
8753 
8754  /* "View.MemoryView":195
8755  * info.len = self.len
8756  * info.ndim = self.ndim
8757  * info.shape = self._shape # <<<<<<<<<<<<<<
8758  * info.strides = self._strides
8759  * info.suboffsets = NULL
8760  */
8761  __pyx_t_7 = __pyx_v_self->_shape;
8762  __pyx_v_info->shape = __pyx_t_7;
8763 
8764  /* "View.MemoryView":196
8765  * info.ndim = self.ndim
8766  * info.shape = self._shape
8767  * info.strides = self._strides # <<<<<<<<<<<<<<
8768  * info.suboffsets = NULL
8769  * info.itemsize = self.itemsize
8770  */
8771  __pyx_t_7 = __pyx_v_self->_strides;
8772  __pyx_v_info->strides = __pyx_t_7;
8773 
8774  /* "View.MemoryView":197
8775  * info.shape = self._shape
8776  * info.strides = self._strides
8777  * info.suboffsets = NULL # <<<<<<<<<<<<<<
8778  * info.itemsize = self.itemsize
8779  * info.readonly = 0
8780  */
8781  __pyx_v_info->suboffsets = NULL;
8782 
8783  /* "View.MemoryView":198
8784  * info.strides = self._strides
8785  * info.suboffsets = NULL
8786  * info.itemsize = self.itemsize # <<<<<<<<<<<<<<
8787  * info.readonly = 0
8788  *
8789  */
8790  __pyx_t_5 = __pyx_v_self->itemsize;
8791  __pyx_v_info->itemsize = __pyx_t_5;
8792 
8793  /* "View.MemoryView":199
8794  * info.suboffsets = NULL
8795  * info.itemsize = self.itemsize
8796  * info.readonly = 0 # <<<<<<<<<<<<<<
8797  *
8798  * if flags & PyBUF_FORMAT:
8799  */
8800  __pyx_v_info->readonly = 0;
8801 
8802  /* "View.MemoryView":201
8803  * info.readonly = 0
8804  *
8805  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8806  * info.format = self.format
8807  * else:
8808  */
8809  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
8810  if (__pyx_t_1) {
8811 
8812  /* "View.MemoryView":202
8813  *
8814  * if flags & PyBUF_FORMAT:
8815  * info.format = self.format # <<<<<<<<<<<<<<
8816  * else:
8817  * info.format = NULL
8818  */
8819  __pyx_t_4 = __pyx_v_self->format;
8820  __pyx_v_info->format = __pyx_t_4;
8821 
8822  /* "View.MemoryView":201
8823  * info.readonly = 0
8824  *
8825  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
8826  * info.format = self.format
8827  * else:
8828  */
8829  goto __pyx_L5;
8830  }
8831 
8832  /* "View.MemoryView":204
8833  * info.format = self.format
8834  * else:
8835  * info.format = NULL # <<<<<<<<<<<<<<
8836  *
8837  * info.obj = self
8838  */
8839  /*else*/ {
8840  __pyx_v_info->format = NULL;
8841  }
8842  __pyx_L5:;
8843 
8844  /* "View.MemoryView":206
8845  * info.format = NULL
8846  *
8847  * info.obj = self # <<<<<<<<<<<<<<
8848  *
8849  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8850  */
8851  __Pyx_INCREF(((PyObject *)__pyx_v_self));
8852  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
8853  __Pyx_GOTREF(__pyx_v_info->obj);
8854  __Pyx_DECREF(__pyx_v_info->obj);
8855  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
8856 
8857  /* "View.MemoryView":184
8858  *
8859  * @cname('getbuffer')
8860  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
8861  * cdef int bufmode = -1
8862  * if self.mode == u"c":
8863  */
8864 
8865  /* function exit code */
8866  __pyx_r = 0;
8867  goto __pyx_L0;
8868  __pyx_L1_error:;
8869  __Pyx_XDECREF(__pyx_t_3);
8870  __Pyx_AddTraceback("View.MemoryView.array.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
8871  __pyx_r = -1;
8872  if (__pyx_v_info->obj != NULL) {
8873  __Pyx_GOTREF(__pyx_v_info->obj);
8874  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8875  }
8876  goto __pyx_L2;
8877  __pyx_L0:;
8878  if (__pyx_v_info->obj == Py_None) {
8879  __Pyx_GOTREF(__pyx_v_info->obj);
8880  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
8881  }
8882  __pyx_L2:;
8883  __Pyx_RefNannyFinishContext();
8884  return __pyx_r;
8885 }
8886 
8887 /* "View.MemoryView":210
8888  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
8889  *
8890  * def __dealloc__(array self): # <<<<<<<<<<<<<<
8891  * if self.callback_free_data != NULL:
8892  * self.callback_free_data(self.data)
8893  */
8894 
8895 /* Python wrapper */
8896 static void __pyx_array___dealloc__(PyObject *__pyx_v_self); /*proto*/
8897 static void __pyx_array___dealloc__(PyObject *__pyx_v_self) {
8898  __Pyx_RefNannyDeclarations
8899  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
8900  __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(((struct __pyx_array_obj *)__pyx_v_self));
8901 
8902  /* function exit code */
8903  __Pyx_RefNannyFinishContext();
8904 }
8905 
8906 static void __pyx_array___pyx_pf_15View_dot_MemoryView_5array_4__dealloc__(struct __pyx_array_obj *__pyx_v_self) {
8907  __Pyx_RefNannyDeclarations
8908  int __pyx_t_1;
8909  __Pyx_RefNannySetupContext("__dealloc__", 0);
8910 
8911  /* "View.MemoryView":211
8912  *
8913  * def __dealloc__(array self):
8914  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8915  * self.callback_free_data(self.data)
8916  * elif self.free_data:
8917  */
8918  __pyx_t_1 = ((__pyx_v_self->callback_free_data != NULL) != 0);
8919  if (__pyx_t_1) {
8920 
8921  /* "View.MemoryView":212
8922  * def __dealloc__(array self):
8923  * if self.callback_free_data != NULL:
8924  * self.callback_free_data(self.data) # <<<<<<<<<<<<<<
8925  * elif self.free_data:
8926  * if self.dtype_is_object:
8927  */
8928  __pyx_v_self->callback_free_data(__pyx_v_self->data);
8929 
8930  /* "View.MemoryView":211
8931  *
8932  * def __dealloc__(array self):
8933  * if self.callback_free_data != NULL: # <<<<<<<<<<<<<<
8934  * self.callback_free_data(self.data)
8935  * elif self.free_data:
8936  */
8937  goto __pyx_L3;
8938  }
8939 
8940  /* "View.MemoryView":213
8941  * if self.callback_free_data != NULL:
8942  * self.callback_free_data(self.data)
8943  * elif self.free_data: # <<<<<<<<<<<<<<
8944  * if self.dtype_is_object:
8945  * refcount_objects_in_slice(self.data, self._shape,
8946  */
8947  __pyx_t_1 = (__pyx_v_self->free_data != 0);
8948  if (__pyx_t_1) {
8949 
8950  /* "View.MemoryView":214
8951  * self.callback_free_data(self.data)
8952  * elif self.free_data:
8953  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8954  * refcount_objects_in_slice(self.data, self._shape,
8955  * self._strides, self.ndim, False)
8956  */
8957  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
8958  if (__pyx_t_1) {
8959 
8960  /* "View.MemoryView":215
8961  * elif self.free_data:
8962  * if self.dtype_is_object:
8963  * refcount_objects_in_slice(self.data, self._shape, # <<<<<<<<<<<<<<
8964  * self._strides, self.ndim, False)
8965  * free(self.data)
8966  */
8967  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_self->data, __pyx_v_self->_shape, __pyx_v_self->_strides, __pyx_v_self->ndim, 0);
8968 
8969  /* "View.MemoryView":214
8970  * self.callback_free_data(self.data)
8971  * elif self.free_data:
8972  * if self.dtype_is_object: # <<<<<<<<<<<<<<
8973  * refcount_objects_in_slice(self.data, self._shape,
8974  * self._strides, self.ndim, False)
8975  */
8976  }
8977 
8978  /* "View.MemoryView":217
8979  * refcount_objects_in_slice(self.data, self._shape,
8980  * self._strides, self.ndim, False)
8981  * free(self.data) # <<<<<<<<<<<<<<
8982  * PyObject_Free(self._shape)
8983  *
8984  */
8985  free(__pyx_v_self->data);
8986 
8987  /* "View.MemoryView":213
8988  * if self.callback_free_data != NULL:
8989  * self.callback_free_data(self.data)
8990  * elif self.free_data: # <<<<<<<<<<<<<<
8991  * if self.dtype_is_object:
8992  * refcount_objects_in_slice(self.data, self._shape,
8993  */
8994  }
8995  __pyx_L3:;
8996 
8997  /* "View.MemoryView":218
8998  * self._strides, self.ndim, False)
8999  * free(self.data)
9000  * PyObject_Free(self._shape) # <<<<<<<<<<<<<<
9001  *
9002  * @property
9003  */
9004  PyObject_Free(__pyx_v_self->_shape);
9005 
9006  /* "View.MemoryView":210
9007  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)")
9008  *
9009  * def __dealloc__(array self): # <<<<<<<<<<<<<<
9010  * if self.callback_free_data != NULL:
9011  * self.callback_free_data(self.data)
9012  */
9013 
9014  /* function exit code */
9015  __Pyx_RefNannyFinishContext();
9016 }
9017 
9018 /* "View.MemoryView":221
9019  *
9020  * @property
9021  * def memview(self): # <<<<<<<<<<<<<<
9022  * return self.get_memview()
9023  *
9024  */
9025 
9026 /* Python wrapper */
9027 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self); /*proto*/
9028 static PyObject *__pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(PyObject *__pyx_v_self) {
9029  PyObject *__pyx_r = 0;
9030  __Pyx_RefNannyDeclarations
9031  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
9032  __pyx_r = __pyx_pf_15View_dot_MemoryView_5array_7memview___get__(((struct __pyx_array_obj *)__pyx_v_self));
9033 
9034  /* function exit code */
9035  __Pyx_RefNannyFinishContext();
9036  return __pyx_r;
9037 }
9038 
9039 static PyObject *__pyx_pf_15View_dot_MemoryView_5array_7memview___get__(struct __pyx_array_obj *__pyx_v_self) {
9040  PyObject *__pyx_r = NULL;
9041  __Pyx_RefNannyDeclarations
9042  PyObject *__pyx_t_1 = NULL;
9043  __Pyx_RefNannySetupContext("__get__", 0);
9044 
9045  /* "View.MemoryView":222
9046  * @property
9047  * def memview(self):
9048  * return self.get_memview() # <<<<<<<<<<<<<<
9049  *
9050  * @cname('get_memview')
9051  */
9052  __Pyx_XDECREF(__pyx_r);
9053  __pyx_t_1 = ((struct __pyx_vtabstruct_array *)__pyx_v_self->__pyx_vtab)->get_memview(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 222, __pyx_L1_error)
9054  __Pyx_GOTREF(__pyx_t_1);
9055  __pyx_r = __pyx_t_1;
9056  __pyx_t_1 = 0;
9057  goto __pyx_L0;
9058 
9059  /* "View.MemoryView":221
9060  *
9061  * @property
9062  * def memview(self): # <<<<<<<<<<<<<<
9063  * return self.get_memview()
9064  *
9065  */
9066 
9067  /* function exit code */
9068  __pyx_L1_error:;
9069  __Pyx_XDECREF(__pyx_t_1);
9070  __Pyx_AddTraceback("View.MemoryView.array.memview.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9071  __pyx_r = NULL;
9072  __pyx_L0:;
9073  __Pyx_XGIVEREF(__pyx_r);
9074  __Pyx_RefNannyFinishContext();
9075  return __pyx_r;
9076 }
9077 
9078 /* "View.MemoryView":225
9079  *
9080  * @cname('get_memview')
9081  * cdef get_memview(self): # <<<<<<<<<<<<<<
9082  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9083  * return memoryview(self, flags, self.dtype_is_object)
9084  */
9085 
9086 static PyObject *__pyx_array_get_memview(struct __pyx_array_obj *__pyx_v_self) {
9087  int __pyx_v_flags;
9088  PyObject *__pyx_r = NULL;
9089  __Pyx_RefNannyDeclarations
9090  PyObject *__pyx_t_1 = NULL;
9091  PyObject *__pyx_t_2 = NULL;
9092  PyObject *__pyx_t_3 = NULL;
9093  __Pyx_RefNannySetupContext("get_memview", 0);
9094 
9095  /* "View.MemoryView":226
9096  * @cname('get_memview')
9097  * cdef get_memview(self):
9098  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE # <<<<<<<<<<<<<<
9099  * return memoryview(self, flags, self.dtype_is_object)
9100  *
9101  */
9102  __pyx_v_flags = ((PyBUF_ANY_CONTIGUOUS | PyBUF_FORMAT) | PyBUF_WRITABLE);
9103 
9104  /* "View.MemoryView":227
9105  * cdef get_memview(self):
9106  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9107  * return memoryview(self, flags, self.dtype_is_object) # <<<<<<<<<<<<<<
9108  *
9109  * def __len__(self):
9110  */
9111  __Pyx_XDECREF(__pyx_r);
9112  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 227, __pyx_L1_error)
9113  __Pyx_GOTREF(__pyx_t_1);
9114  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
9115  __Pyx_GOTREF(__pyx_t_2);
9116  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 227, __pyx_L1_error)
9117  __Pyx_GOTREF(__pyx_t_3);
9118  __Pyx_INCREF(((PyObject *)__pyx_v_self));
9119  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
9120  PyTuple_SET_ITEM(__pyx_t_3, 0, ((PyObject *)__pyx_v_self));
9121  __Pyx_GIVEREF(__pyx_t_1);
9122  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
9123  __Pyx_GIVEREF(__pyx_t_2);
9124  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
9125  __pyx_t_1 = 0;
9126  __pyx_t_2 = 0;
9127  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 227, __pyx_L1_error)
9128  __Pyx_GOTREF(__pyx_t_2);
9129  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9130  __pyx_r = __pyx_t_2;
9131  __pyx_t_2 = 0;
9132  goto __pyx_L0;
9133 
9134  /* "View.MemoryView":225
9135  *
9136  * @cname('get_memview')
9137  * cdef get_memview(self): # <<<<<<<<<<<<<<
9138  * flags = PyBUF_ANY_CONTIGUOUS|PyBUF_FORMAT|PyBUF_WRITABLE
9139  * return memoryview(self, flags, self.dtype_is_object)
9140  */
9141 
9142  /* function exit code */
9143  __pyx_L1_error:;
9144  __Pyx_XDECREF(__pyx_t_1);
9145  __Pyx_XDECREF(__pyx_t_2);
9146  __Pyx_XDECREF(__pyx_t_3);
9147  __Pyx_AddTraceback("View.MemoryView.array.get_memview", __pyx_clineno, __pyx_lineno, __pyx_filename);
9148  __pyx_r = 0;
9149  __pyx_L0:;
9150  __Pyx_XGIVEREF(__pyx_r);
9151  __Pyx_RefNannyFinishContext();
9152  return __pyx_r;
9153 }
9154 
9155 /* "View.MemoryView":229
9156  * return memoryview(self, flags, self.dtype_is_object)
9157  *
9158  * def __len__(self): # <<<<<<<<<<<<<<
9159  * return self._shape[0]
9160  *
9161  */
9162 
9163 /* Python wrapper */
9164 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self); /*proto*/
9165 static Py_ssize_t __pyx_array___len__(PyObject *__pyx_v_self) {
9166  Py_ssize_t __pyx_r;
9167  __Pyx_RefNannyDeclarations
9168  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
9169  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(((struct __pyx_array_obj *)__pyx_v_self));
9170 
9171  /* function exit code */
9172  __Pyx_RefNannyFinishContext();
9173  return __pyx_r;
9174 }
9175 
9176 static Py_ssize_t __pyx_array___pyx_pf_15View_dot_MemoryView_5array_6__len__(struct __pyx_array_obj *__pyx_v_self) {
9177  Py_ssize_t __pyx_r;
9178  __Pyx_RefNannyDeclarations
9179  __Pyx_RefNannySetupContext("__len__", 0);
9180 
9181  /* "View.MemoryView":230
9182  *
9183  * def __len__(self):
9184  * return self._shape[0] # <<<<<<<<<<<<<<
9185  *
9186  * def __getattr__(self, attr):
9187  */
9188  __pyx_r = (__pyx_v_self->_shape[0]);
9189  goto __pyx_L0;
9190 
9191  /* "View.MemoryView":229
9192  * return memoryview(self, flags, self.dtype_is_object)
9193  *
9194  * def __len__(self): # <<<<<<<<<<<<<<
9195  * return self._shape[0]
9196  *
9197  */
9198 
9199  /* function exit code */
9200  __pyx_L0:;
9201  __Pyx_RefNannyFinishContext();
9202  return __pyx_r;
9203 }
9204 
9205 /* "View.MemoryView":232
9206  * return self._shape[0]
9207  *
9208  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9209  * return getattr(self.memview, attr)
9210  *
9211  */
9212 
9213 /* Python wrapper */
9214 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr); /*proto*/
9215 static PyObject *__pyx_array___getattr__(PyObject *__pyx_v_self, PyObject *__pyx_v_attr) {
9216  PyObject *__pyx_r = 0;
9217  __Pyx_RefNannyDeclarations
9218  __Pyx_RefNannySetupContext("__getattr__ (wrapper)", 0);
9219  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_attr));
9220 
9221  /* function exit code */
9222  __Pyx_RefNannyFinishContext();
9223  return __pyx_r;
9224 }
9225 
9226 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_8__getattr__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_attr) {
9227  PyObject *__pyx_r = NULL;
9228  __Pyx_RefNannyDeclarations
9229  PyObject *__pyx_t_1 = NULL;
9230  PyObject *__pyx_t_2 = NULL;
9231  __Pyx_RefNannySetupContext("__getattr__", 0);
9232 
9233  /* "View.MemoryView":233
9234  *
9235  * def __getattr__(self, attr):
9236  * return getattr(self.memview, attr) # <<<<<<<<<<<<<<
9237  *
9238  * def __getitem__(self, item):
9239  */
9240  __Pyx_XDECREF(__pyx_r);
9241  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 233, __pyx_L1_error)
9242  __Pyx_GOTREF(__pyx_t_1);
9243  __pyx_t_2 = __Pyx_GetAttr(__pyx_t_1, __pyx_v_attr); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 233, __pyx_L1_error)
9244  __Pyx_GOTREF(__pyx_t_2);
9245  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9246  __pyx_r = __pyx_t_2;
9247  __pyx_t_2 = 0;
9248  goto __pyx_L0;
9249 
9250  /* "View.MemoryView":232
9251  * return self._shape[0]
9252  *
9253  * def __getattr__(self, attr): # <<<<<<<<<<<<<<
9254  * return getattr(self.memview, attr)
9255  *
9256  */
9257 
9258  /* function exit code */
9259  __pyx_L1_error:;
9260  __Pyx_XDECREF(__pyx_t_1);
9261  __Pyx_XDECREF(__pyx_t_2);
9262  __Pyx_AddTraceback("View.MemoryView.array.__getattr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9263  __pyx_r = NULL;
9264  __pyx_L0:;
9265  __Pyx_XGIVEREF(__pyx_r);
9266  __Pyx_RefNannyFinishContext();
9267  return __pyx_r;
9268 }
9269 
9270 /* "View.MemoryView":235
9271  * return getattr(self.memview, attr)
9272  *
9273  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9274  * return self.memview[item]
9275  *
9276  */
9277 
9278 /* Python wrapper */
9279 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item); /*proto*/
9280 static PyObject *__pyx_array___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item) {
9281  PyObject *__pyx_r = 0;
9282  __Pyx_RefNannyDeclarations
9283  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
9284  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item));
9285 
9286  /* function exit code */
9287  __Pyx_RefNannyFinishContext();
9288  return __pyx_r;
9289 }
9290 
9291 static PyObject *__pyx_array___pyx_pf_15View_dot_MemoryView_5array_10__getitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item) {
9292  PyObject *__pyx_r = NULL;
9293  __Pyx_RefNannyDeclarations
9294  PyObject *__pyx_t_1 = NULL;
9295  PyObject *__pyx_t_2 = NULL;
9296  __Pyx_RefNannySetupContext("__getitem__", 0);
9297 
9298  /* "View.MemoryView":236
9299  *
9300  * def __getitem__(self, item):
9301  * return self.memview[item] # <<<<<<<<<<<<<<
9302  *
9303  * def __setitem__(self, item, value):
9304  */
9305  __Pyx_XDECREF(__pyx_r);
9306  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 236, __pyx_L1_error)
9307  __Pyx_GOTREF(__pyx_t_1);
9308  __pyx_t_2 = __Pyx_PyObject_GetItem(__pyx_t_1, __pyx_v_item); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 236, __pyx_L1_error)
9309  __Pyx_GOTREF(__pyx_t_2);
9310  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9311  __pyx_r = __pyx_t_2;
9312  __pyx_t_2 = 0;
9313  goto __pyx_L0;
9314 
9315  /* "View.MemoryView":235
9316  * return getattr(self.memview, attr)
9317  *
9318  * def __getitem__(self, item): # <<<<<<<<<<<<<<
9319  * return self.memview[item]
9320  *
9321  */
9322 
9323  /* function exit code */
9324  __pyx_L1_error:;
9325  __Pyx_XDECREF(__pyx_t_1);
9326  __Pyx_XDECREF(__pyx_t_2);
9327  __Pyx_AddTraceback("View.MemoryView.array.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9328  __pyx_r = NULL;
9329  __pyx_L0:;
9330  __Pyx_XGIVEREF(__pyx_r);
9331  __Pyx_RefNannyFinishContext();
9332  return __pyx_r;
9333 }
9334 
9335 /* "View.MemoryView":238
9336  * return self.memview[item]
9337  *
9338  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9339  * self.memview[item] = value
9340  *
9341  */
9342 
9343 /* Python wrapper */
9344 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value); /*proto*/
9345 static int __pyx_array___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9346  int __pyx_r;
9347  __Pyx_RefNannyDeclarations
9348  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
9349  __pyx_r = __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v_item), ((PyObject *)__pyx_v_value));
9350 
9351  /* function exit code */
9352  __Pyx_RefNannyFinishContext();
9353  return __pyx_r;
9354 }
9355 
9356 static int __pyx_array___pyx_pf_15View_dot_MemoryView_5array_12__setitem__(struct __pyx_array_obj *__pyx_v_self, PyObject *__pyx_v_item, PyObject *__pyx_v_value) {
9357  int __pyx_r;
9358  __Pyx_RefNannyDeclarations
9359  PyObject *__pyx_t_1 = NULL;
9360  __Pyx_RefNannySetupContext("__setitem__", 0);
9361 
9362  /* "View.MemoryView":239
9363  *
9364  * def __setitem__(self, item, value):
9365  * self.memview[item] = value # <<<<<<<<<<<<<<
9366  *
9367  *
9368  */
9369  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_memview); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 239, __pyx_L1_error)
9370  __Pyx_GOTREF(__pyx_t_1);
9371  if (unlikely(PyObject_SetItem(__pyx_t_1, __pyx_v_item, __pyx_v_value) < 0)) __PYX_ERR(0, 239, __pyx_L1_error)
9372  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9373 
9374  /* "View.MemoryView":238
9375  * return self.memview[item]
9376  *
9377  * def __setitem__(self, item, value): # <<<<<<<<<<<<<<
9378  * self.memview[item] = value
9379  *
9380  */
9381 
9382  /* function exit code */
9383  __pyx_r = 0;
9384  goto __pyx_L0;
9385  __pyx_L1_error:;
9386  __Pyx_XDECREF(__pyx_t_1);
9387  __Pyx_AddTraceback("View.MemoryView.array.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9388  __pyx_r = -1;
9389  __pyx_L0:;
9390  __Pyx_RefNannyFinishContext();
9391  return __pyx_r;
9392 }
9393 
9394 /* "(tree fragment)":1
9395  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9396  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9397  * def __setstate_cython__(self, __pyx_state):
9398  */
9399 
9400 /* Python wrapper */
9401 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9402 static PyMethodDef __pyx_mdef___pyx_array_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0};
9403 static PyObject *__pyx_pw___pyx_array_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9404  PyObject *__pyx_r = 0;
9405  __Pyx_RefNannyDeclarations
9406  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9407  __pyx_r = __pyx_pf___pyx_array___reduce_cython__(((struct __pyx_array_obj *)__pyx_v_self));
9408 
9409  /* function exit code */
9410  __Pyx_RefNannyFinishContext();
9411  return __pyx_r;
9412 }
9413 
9414 static PyObject *__pyx_pf___pyx_array___reduce_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self) {
9415  PyObject *__pyx_r = NULL;
9416  __Pyx_RefNannyDeclarations
9417  PyObject *__pyx_t_1 = NULL;
9418  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9419 
9420  /* "(tree fragment)":2
9421  * def __reduce_cython__(self):
9422  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9423  * def __setstate_cython__(self, __pyx_state):
9424  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9425  */
9426  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__18, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
9427  __Pyx_GOTREF(__pyx_t_1);
9428  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9429  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9430  __PYX_ERR(0, 2, __pyx_L1_error)
9431 
9432  /* "(tree fragment)":1
9433  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9434  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9435  * def __setstate_cython__(self, __pyx_state):
9436  */
9437 
9438  /* function exit code */
9439  __pyx_L1_error:;
9440  __Pyx_XDECREF(__pyx_t_1);
9441  __Pyx_AddTraceback("View.MemoryView.array.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9442  __pyx_r = NULL;
9443  __Pyx_XGIVEREF(__pyx_r);
9444  __Pyx_RefNannyFinishContext();
9445  return __pyx_r;
9446 }
9447 
9448 /* "(tree fragment)":3
9449  * def __reduce_cython__(self):
9450  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9451  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9452  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9453  */
9454 
9455 /* Python wrapper */
9456 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
9457 static PyMethodDef __pyx_mdef___pyx_array_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0};
9458 static PyObject *__pyx_pw___pyx_array_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
9459  PyObject *__pyx_r = 0;
9460  __Pyx_RefNannyDeclarations
9461  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
9462  __pyx_r = __pyx_pf___pyx_array_2__setstate_cython__(((struct __pyx_array_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
9463 
9464  /* function exit code */
9465  __Pyx_RefNannyFinishContext();
9466  return __pyx_r;
9467 }
9468 
9469 static PyObject *__pyx_pf___pyx_array_2__setstate_cython__(CYTHON_UNUSED struct __pyx_array_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
9470  PyObject *__pyx_r = NULL;
9471  __Pyx_RefNannyDeclarations
9472  PyObject *__pyx_t_1 = NULL;
9473  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
9474 
9475  /* "(tree fragment)":4
9476  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9477  * def __setstate_cython__(self, __pyx_state):
9478  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
9479  */
9480  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__19, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
9481  __Pyx_GOTREF(__pyx_t_1);
9482  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
9483  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9484  __PYX_ERR(0, 4, __pyx_L1_error)
9485 
9486  /* "(tree fragment)":3
9487  * def __reduce_cython__(self):
9488  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9489  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
9490  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
9491  */
9492 
9493  /* function exit code */
9494  __pyx_L1_error:;
9495  __Pyx_XDECREF(__pyx_t_1);
9496  __Pyx_AddTraceback("View.MemoryView.array.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9497  __pyx_r = NULL;
9498  __Pyx_XGIVEREF(__pyx_r);
9499  __Pyx_RefNannyFinishContext();
9500  return __pyx_r;
9501 }
9502 
9503 /* "View.MemoryView":243
9504  *
9505  * @cname("__pyx_array_new")
9506  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9507  * char *mode, char *buf):
9508  * cdef array result
9509  */
9510 
9511 static struct __pyx_array_obj *__pyx_array_new(PyObject *__pyx_v_shape, Py_ssize_t __pyx_v_itemsize, char *__pyx_v_format, char *__pyx_v_mode, char *__pyx_v_buf) {
9512  struct __pyx_array_obj *__pyx_v_result = 0;
9513  struct __pyx_array_obj *__pyx_r = NULL;
9514  __Pyx_RefNannyDeclarations
9515  int __pyx_t_1;
9516  PyObject *__pyx_t_2 = NULL;
9517  PyObject *__pyx_t_3 = NULL;
9518  PyObject *__pyx_t_4 = NULL;
9519  PyObject *__pyx_t_5 = NULL;
9520  __Pyx_RefNannySetupContext("array_cwrapper", 0);
9521 
9522  /* "View.MemoryView":247
9523  * cdef array result
9524  *
9525  * if buf == NULL: # <<<<<<<<<<<<<<
9526  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9527  * else:
9528  */
9529  __pyx_t_1 = ((__pyx_v_buf == NULL) != 0);
9530  if (__pyx_t_1) {
9531 
9532  /* "View.MemoryView":248
9533  *
9534  * if buf == NULL:
9535  * result = array(shape, itemsize, format, mode.decode('ASCII')) # <<<<<<<<<<<<<<
9536  * else:
9537  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9538  */
9539  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 248, __pyx_L1_error)
9540  __Pyx_GOTREF(__pyx_t_2);
9541  __pyx_t_3 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 248, __pyx_L1_error)
9542  __Pyx_GOTREF(__pyx_t_3);
9543  __pyx_t_4 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
9544  __Pyx_GOTREF(__pyx_t_4);
9545  __pyx_t_5 = PyTuple_New(4); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 248, __pyx_L1_error)
9546  __Pyx_GOTREF(__pyx_t_5);
9547  __Pyx_INCREF(__pyx_v_shape);
9548  __Pyx_GIVEREF(__pyx_v_shape);
9549  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_v_shape);
9550  __Pyx_GIVEREF(__pyx_t_2);
9551  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_2);
9552  __Pyx_GIVEREF(__pyx_t_3);
9553  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_t_3);
9554  __Pyx_GIVEREF(__pyx_t_4);
9555  PyTuple_SET_ITEM(__pyx_t_5, 3, __pyx_t_4);
9556  __pyx_t_2 = 0;
9557  __pyx_t_3 = 0;
9558  __pyx_t_4 = 0;
9559  __pyx_t_4 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_5, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 248, __pyx_L1_error)
9560  __Pyx_GOTREF(__pyx_t_4);
9561  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
9562  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_4);
9563  __pyx_t_4 = 0;
9564 
9565  /* "View.MemoryView":247
9566  * cdef array result
9567  *
9568  * if buf == NULL: # <<<<<<<<<<<<<<
9569  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9570  * else:
9571  */
9572  goto __pyx_L3;
9573  }
9574 
9575  /* "View.MemoryView":250
9576  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9577  * else:
9578  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9579  * allocate_buffer=False)
9580  * result.data = buf
9581  */
9582  /*else*/ {
9583  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_itemsize); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 250, __pyx_L1_error)
9584  __Pyx_GOTREF(__pyx_t_4);
9585  __pyx_t_5 = __Pyx_PyBytes_FromString(__pyx_v_format); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
9586  __Pyx_GOTREF(__pyx_t_5);
9587  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_mode, 0, strlen(__pyx_v_mode), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 250, __pyx_L1_error)
9588  __Pyx_GOTREF(__pyx_t_3);
9589  __pyx_t_2 = PyTuple_New(4); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 250, __pyx_L1_error)
9590  __Pyx_GOTREF(__pyx_t_2);
9591  __Pyx_INCREF(__pyx_v_shape);
9592  __Pyx_GIVEREF(__pyx_v_shape);
9593  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_v_shape);
9594  __Pyx_GIVEREF(__pyx_t_4);
9595  PyTuple_SET_ITEM(__pyx_t_2, 1, __pyx_t_4);
9596  __Pyx_GIVEREF(__pyx_t_5);
9597  PyTuple_SET_ITEM(__pyx_t_2, 2, __pyx_t_5);
9598  __Pyx_GIVEREF(__pyx_t_3);
9599  PyTuple_SET_ITEM(__pyx_t_2, 3, __pyx_t_3);
9600  __pyx_t_4 = 0;
9601  __pyx_t_5 = 0;
9602  __pyx_t_3 = 0;
9603 
9604  /* "View.MemoryView":251
9605  * else:
9606  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9607  * allocate_buffer=False) # <<<<<<<<<<<<<<
9608  * result.data = buf
9609  *
9610  */
9611  __pyx_t_3 = __Pyx_PyDict_NewPresized(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 251, __pyx_L1_error)
9612  __Pyx_GOTREF(__pyx_t_3);
9613  if (PyDict_SetItem(__pyx_t_3, __pyx_n_s_allocate_buffer, Py_False) < 0) __PYX_ERR(0, 251, __pyx_L1_error)
9614 
9615  /* "View.MemoryView":250
9616  * result = array(shape, itemsize, format, mode.decode('ASCII'))
9617  * else:
9618  * result = array(shape, itemsize, format, mode.decode('ASCII'), # <<<<<<<<<<<<<<
9619  * allocate_buffer=False)
9620  * result.data = buf
9621  */
9622  __pyx_t_5 = __Pyx_PyObject_Call(((PyObject *)__pyx_array_type), __pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 250, __pyx_L1_error)
9623  __Pyx_GOTREF(__pyx_t_5);
9624  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
9625  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
9626  __pyx_v_result = ((struct __pyx_array_obj *)__pyx_t_5);
9627  __pyx_t_5 = 0;
9628 
9629  /* "View.MemoryView":252
9630  * result = array(shape, itemsize, format, mode.decode('ASCII'),
9631  * allocate_buffer=False)
9632  * result.data = buf # <<<<<<<<<<<<<<
9633  *
9634  * return result
9635  */
9636  __pyx_v_result->data = __pyx_v_buf;
9637  }
9638  __pyx_L3:;
9639 
9640  /* "View.MemoryView":254
9641  * result.data = buf
9642  *
9643  * return result # <<<<<<<<<<<<<<
9644  *
9645  *
9646  */
9647  __Pyx_XDECREF(((PyObject *)__pyx_r));
9648  __Pyx_INCREF(((PyObject *)__pyx_v_result));
9649  __pyx_r = __pyx_v_result;
9650  goto __pyx_L0;
9651 
9652  /* "View.MemoryView":243
9653  *
9654  * @cname("__pyx_array_new")
9655  * cdef array array_cwrapper(tuple shape, Py_ssize_t itemsize, char *format, # <<<<<<<<<<<<<<
9656  * char *mode, char *buf):
9657  * cdef array result
9658  */
9659 
9660  /* function exit code */
9661  __pyx_L1_error:;
9662  __Pyx_XDECREF(__pyx_t_2);
9663  __Pyx_XDECREF(__pyx_t_3);
9664  __Pyx_XDECREF(__pyx_t_4);
9665  __Pyx_XDECREF(__pyx_t_5);
9666  __Pyx_AddTraceback("View.MemoryView.array_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
9667  __pyx_r = 0;
9668  __pyx_L0:;
9669  __Pyx_XDECREF((PyObject *)__pyx_v_result);
9670  __Pyx_XGIVEREF((PyObject *)__pyx_r);
9671  __Pyx_RefNannyFinishContext();
9672  return __pyx_r;
9673 }
9674 
9675 /* "View.MemoryView":280
9676  * cdef class Enum(object):
9677  * cdef object name
9678  * def __init__(self, name): # <<<<<<<<<<<<<<
9679  * self.name = name
9680  * def __repr__(self):
9681  */
9682 
9683 /* Python wrapper */
9684 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
9685 static int __pyx_MemviewEnum___init__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
9686  PyObject *__pyx_v_name = 0;
9687  int __pyx_r;
9688  __Pyx_RefNannyDeclarations
9689  __Pyx_RefNannySetupContext("__init__ (wrapper)", 0);
9690  {
9691  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_name,0};
9692  PyObject* values[1] = {0};
9693  if (unlikely(__pyx_kwds)) {
9694  Py_ssize_t kw_args;
9695  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
9696  switch (pos_args) {
9697  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9698  CYTHON_FALLTHROUGH;
9699  case 0: break;
9700  default: goto __pyx_L5_argtuple_error;
9701  }
9702  kw_args = PyDict_Size(__pyx_kwds);
9703  switch (pos_args) {
9704  case 0:
9705  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_name)) != 0)) kw_args--;
9706  else goto __pyx_L5_argtuple_error;
9707  }
9708  if (unlikely(kw_args > 0)) {
9709  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__init__") < 0)) __PYX_ERR(0, 280, __pyx_L3_error)
9710  }
9711  } else if (PyTuple_GET_SIZE(__pyx_args) != 1) {
9712  goto __pyx_L5_argtuple_error;
9713  } else {
9714  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
9715  }
9716  __pyx_v_name = values[0];
9717  }
9718  goto __pyx_L4_argument_unpacking_done;
9719  __pyx_L5_argtuple_error:;
9720  __Pyx_RaiseArgtupleInvalid("__init__", 1, 1, 1, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 280, __pyx_L3_error)
9721  __pyx_L3_error:;
9722  __Pyx_AddTraceback("View.MemoryView.Enum.__init__", __pyx_clineno, __pyx_lineno, __pyx_filename);
9723  __Pyx_RefNannyFinishContext();
9724  return -1;
9725  __pyx_L4_argument_unpacking_done:;
9726  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), __pyx_v_name);
9727 
9728  /* function exit code */
9729  __Pyx_RefNannyFinishContext();
9730  return __pyx_r;
9731 }
9732 
9733 static int __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum___init__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v_name) {
9734  int __pyx_r;
9735  __Pyx_RefNannyDeclarations
9736  __Pyx_RefNannySetupContext("__init__", 0);
9737 
9738  /* "View.MemoryView":281
9739  * cdef object name
9740  * def __init__(self, name):
9741  * self.name = name # <<<<<<<<<<<<<<
9742  * def __repr__(self):
9743  * return self.name
9744  */
9745  __Pyx_INCREF(__pyx_v_name);
9746  __Pyx_GIVEREF(__pyx_v_name);
9747  __Pyx_GOTREF(__pyx_v_self->name);
9748  __Pyx_DECREF(__pyx_v_self->name);
9749  __pyx_v_self->name = __pyx_v_name;
9750 
9751  /* "View.MemoryView":280
9752  * cdef class Enum(object):
9753  * cdef object name
9754  * def __init__(self, name): # <<<<<<<<<<<<<<
9755  * self.name = name
9756  * def __repr__(self):
9757  */
9758 
9759  /* function exit code */
9760  __pyx_r = 0;
9761  __Pyx_RefNannyFinishContext();
9762  return __pyx_r;
9763 }
9764 
9765 /* "View.MemoryView":282
9766  * def __init__(self, name):
9767  * self.name = name
9768  * def __repr__(self): # <<<<<<<<<<<<<<
9769  * return self.name
9770  *
9771  */
9772 
9773 /* Python wrapper */
9774 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self); /*proto*/
9775 static PyObject *__pyx_MemviewEnum___repr__(PyObject *__pyx_v_self) {
9776  PyObject *__pyx_r = 0;
9777  __Pyx_RefNannyDeclarations
9778  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
9779  __pyx_r = __pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9780 
9781  /* function exit code */
9782  __Pyx_RefNannyFinishContext();
9783  return __pyx_r;
9784 }
9785 
9786 static PyObject *__pyx_MemviewEnum___pyx_pf_15View_dot_MemoryView_4Enum_2__repr__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9787  PyObject *__pyx_r = NULL;
9788  __Pyx_RefNannyDeclarations
9789  __Pyx_RefNannySetupContext("__repr__", 0);
9790 
9791  /* "View.MemoryView":283
9792  * self.name = name
9793  * def __repr__(self):
9794  * return self.name # <<<<<<<<<<<<<<
9795  *
9796  * cdef generic = Enum("<strided and direct or indirect>")
9797  */
9798  __Pyx_XDECREF(__pyx_r);
9799  __Pyx_INCREF(__pyx_v_self->name);
9800  __pyx_r = __pyx_v_self->name;
9801  goto __pyx_L0;
9802 
9803  /* "View.MemoryView":282
9804  * def __init__(self, name):
9805  * self.name = name
9806  * def __repr__(self): # <<<<<<<<<<<<<<
9807  * return self.name
9808  *
9809  */
9810 
9811  /* function exit code */
9812  __pyx_L0:;
9813  __Pyx_XGIVEREF(__pyx_r);
9814  __Pyx_RefNannyFinishContext();
9815  return __pyx_r;
9816 }
9817 
9818 /* "(tree fragment)":1
9819  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
9820  * cdef bint use_setstate
9821  * state = (self.name,)
9822  */
9823 
9824 /* Python wrapper */
9825 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
9826 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0};
9827 static PyObject *__pyx_pw___pyx_MemviewEnum_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
9828  PyObject *__pyx_r = 0;
9829  __Pyx_RefNannyDeclarations
9830  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
9831  __pyx_r = __pyx_pf___pyx_MemviewEnum___reduce_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self));
9832 
9833  /* function exit code */
9834  __Pyx_RefNannyFinishContext();
9835  return __pyx_r;
9836 }
9837 
9838 static PyObject *__pyx_pf___pyx_MemviewEnum___reduce_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self) {
9839  int __pyx_v_use_setstate;
9840  PyObject *__pyx_v_state = NULL;
9841  PyObject *__pyx_v__dict = NULL;
9842  PyObject *__pyx_r = NULL;
9843  __Pyx_RefNannyDeclarations
9844  PyObject *__pyx_t_1 = NULL;
9845  int __pyx_t_2;
9846  int __pyx_t_3;
9847  PyObject *__pyx_t_4 = NULL;
9848  PyObject *__pyx_t_5 = NULL;
9849  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
9850 
9851  /* "(tree fragment)":3
9852  * def __reduce_cython__(self):
9853  * cdef bint use_setstate
9854  * state = (self.name,) # <<<<<<<<<<<<<<
9855  * _dict = getattr(self, '__dict__', None)
9856  * if _dict is not None:
9857  */
9858  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
9859  __Pyx_GOTREF(__pyx_t_1);
9860  __Pyx_INCREF(__pyx_v_self->name);
9861  __Pyx_GIVEREF(__pyx_v_self->name);
9862  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v_self->name);
9863  __pyx_v_state = ((PyObject*)__pyx_t_1);
9864  __pyx_t_1 = 0;
9865 
9866  /* "(tree fragment)":4
9867  * cdef bint use_setstate
9868  * state = (self.name,)
9869  * _dict = getattr(self, '__dict__', None) # <<<<<<<<<<<<<<
9870  * if _dict is not None:
9871  * state += (_dict,)
9872  */
9873  __pyx_t_1 = __Pyx_GetAttr3(((PyObject *)__pyx_v_self), __pyx_n_s_dict, Py_None); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
9874  __Pyx_GOTREF(__pyx_t_1);
9875  __pyx_v__dict = __pyx_t_1;
9876  __pyx_t_1 = 0;
9877 
9878  /* "(tree fragment)":5
9879  * state = (self.name,)
9880  * _dict = getattr(self, '__dict__', None)
9881  * if _dict is not None: # <<<<<<<<<<<<<<
9882  * state += (_dict,)
9883  * use_setstate = True
9884  */
9885  __pyx_t_2 = (__pyx_v__dict != Py_None);
9886  __pyx_t_3 = (__pyx_t_2 != 0);
9887  if (__pyx_t_3) {
9888 
9889  /* "(tree fragment)":6
9890  * _dict = getattr(self, '__dict__', None)
9891  * if _dict is not None:
9892  * state += (_dict,) # <<<<<<<<<<<<<<
9893  * use_setstate = True
9894  * else:
9895  */
9896  __pyx_t_1 = PyTuple_New(1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 6, __pyx_L1_error)
9897  __Pyx_GOTREF(__pyx_t_1);
9898  __Pyx_INCREF(__pyx_v__dict);
9899  __Pyx_GIVEREF(__pyx_v__dict);
9900  PyTuple_SET_ITEM(__pyx_t_1, 0, __pyx_v__dict);
9901  __pyx_t_4 = PyNumber_InPlaceAdd(__pyx_v_state, __pyx_t_1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 6, __pyx_L1_error)
9902  __Pyx_GOTREF(__pyx_t_4);
9903  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
9904  __Pyx_DECREF_SET(__pyx_v_state, ((PyObject*)__pyx_t_4));
9905  __pyx_t_4 = 0;
9906 
9907  /* "(tree fragment)":7
9908  * if _dict is not None:
9909  * state += (_dict,)
9910  * use_setstate = True # <<<<<<<<<<<<<<
9911  * else:
9912  * use_setstate = self.name is not None
9913  */
9914  __pyx_v_use_setstate = 1;
9915 
9916  /* "(tree fragment)":5
9917  * state = (self.name,)
9918  * _dict = getattr(self, '__dict__', None)
9919  * if _dict is not None: # <<<<<<<<<<<<<<
9920  * state += (_dict,)
9921  * use_setstate = True
9922  */
9923  goto __pyx_L3;
9924  }
9925 
9926  /* "(tree fragment)":9
9927  * use_setstate = True
9928  * else:
9929  * use_setstate = self.name is not None # <<<<<<<<<<<<<<
9930  * if use_setstate:
9931  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9932  */
9933  /*else*/ {
9934  __pyx_t_3 = (__pyx_v_self->name != Py_None);
9935  __pyx_v_use_setstate = __pyx_t_3;
9936  }
9937  __pyx_L3:;
9938 
9939  /* "(tree fragment)":10
9940  * else:
9941  * use_setstate = self.name is not None
9942  * if use_setstate: # <<<<<<<<<<<<<<
9943  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9944  * else:
9945  */
9946  __pyx_t_3 = (__pyx_v_use_setstate != 0);
9947  if (__pyx_t_3) {
9948 
9949  /* "(tree fragment)":11
9950  * use_setstate = self.name is not None
9951  * if use_setstate:
9952  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state # <<<<<<<<<<<<<<
9953  * else:
9954  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
9955  */
9956  __Pyx_XDECREF(__pyx_r);
9957  __pyx_t_4 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 11, __pyx_L1_error)
9958  __Pyx_GOTREF(__pyx_t_4);
9959  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 11, __pyx_L1_error)
9960  __Pyx_GOTREF(__pyx_t_1);
9961  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9962  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9963  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
9964  __Pyx_INCREF(__pyx_int_184977713);
9965  __Pyx_GIVEREF(__pyx_int_184977713);
9966  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
9967  __Pyx_INCREF(Py_None);
9968  __Pyx_GIVEREF(Py_None);
9969  PyTuple_SET_ITEM(__pyx_t_1, 2, Py_None);
9970  __pyx_t_5 = PyTuple_New(3); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 11, __pyx_L1_error)
9971  __Pyx_GOTREF(__pyx_t_5);
9972  __Pyx_GIVEREF(__pyx_t_4);
9973  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
9974  __Pyx_GIVEREF(__pyx_t_1);
9975  PyTuple_SET_ITEM(__pyx_t_5, 1, __pyx_t_1);
9976  __Pyx_INCREF(__pyx_v_state);
9977  __Pyx_GIVEREF(__pyx_v_state);
9978  PyTuple_SET_ITEM(__pyx_t_5, 2, __pyx_v_state);
9979  __pyx_t_4 = 0;
9980  __pyx_t_1 = 0;
9981  __pyx_r = __pyx_t_5;
9982  __pyx_t_5 = 0;
9983  goto __pyx_L0;
9984 
9985  /* "(tree fragment)":10
9986  * else:
9987  * use_setstate = self.name is not None
9988  * if use_setstate: # <<<<<<<<<<<<<<
9989  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9990  * else:
9991  */
9992  }
9993 
9994  /* "(tree fragment)":13
9995  * return __pyx_unpickle_Enum, (type(self), 0xb068931, None), state
9996  * else:
9997  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state) # <<<<<<<<<<<<<<
9998  * def __setstate_cython__(self, __pyx_state):
9999  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10000  */
10001  /*else*/ {
10002  __Pyx_XDECREF(__pyx_r);
10003  __pyx_t_5 = __Pyx_GetModuleGlobalName(__pyx_n_s_pyx_unpickle_Enum); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 13, __pyx_L1_error)
10004  __Pyx_GOTREF(__pyx_t_5);
10005  __pyx_t_1 = PyTuple_New(3); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 13, __pyx_L1_error)
10006  __Pyx_GOTREF(__pyx_t_1);
10007  __Pyx_INCREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10008  __Pyx_GIVEREF(((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10009  PyTuple_SET_ITEM(__pyx_t_1, 0, ((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))));
10010  __Pyx_INCREF(__pyx_int_184977713);
10011  __Pyx_GIVEREF(__pyx_int_184977713);
10012  PyTuple_SET_ITEM(__pyx_t_1, 1, __pyx_int_184977713);
10013  __Pyx_INCREF(__pyx_v_state);
10014  __Pyx_GIVEREF(__pyx_v_state);
10015  PyTuple_SET_ITEM(__pyx_t_1, 2, __pyx_v_state);
10016  __pyx_t_4 = PyTuple_New(2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 13, __pyx_L1_error)
10017  __Pyx_GOTREF(__pyx_t_4);
10018  __Pyx_GIVEREF(__pyx_t_5);
10019  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_5);
10020  __Pyx_GIVEREF(__pyx_t_1);
10021  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_1);
10022  __pyx_t_5 = 0;
10023  __pyx_t_1 = 0;
10024  __pyx_r = __pyx_t_4;
10025  __pyx_t_4 = 0;
10026  goto __pyx_L0;
10027  }
10028 
10029  /* "(tree fragment)":1
10030  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
10031  * cdef bint use_setstate
10032  * state = (self.name,)
10033  */
10034 
10035  /* function exit code */
10036  __pyx_L1_error:;
10037  __Pyx_XDECREF(__pyx_t_1);
10038  __Pyx_XDECREF(__pyx_t_4);
10039  __Pyx_XDECREF(__pyx_t_5);
10040  __Pyx_AddTraceback("View.MemoryView.Enum.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10041  __pyx_r = NULL;
10042  __pyx_L0:;
10043  __Pyx_XDECREF(__pyx_v_state);
10044  __Pyx_XDECREF(__pyx_v__dict);
10045  __Pyx_XGIVEREF(__pyx_r);
10046  __Pyx_RefNannyFinishContext();
10047  return __pyx_r;
10048 }
10049 
10050 /* "(tree fragment)":14
10051  * else:
10052  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10053  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10054  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10055  */
10056 
10057 /* Python wrapper */
10058 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
10059 static PyMethodDef __pyx_mdef___pyx_MemviewEnum_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0};
10060 static PyObject *__pyx_pw___pyx_MemviewEnum_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10061  PyObject *__pyx_r = 0;
10062  __Pyx_RefNannyDeclarations
10063  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
10064  __pyx_r = __pyx_pf___pyx_MemviewEnum_2__setstate_cython__(((struct __pyx_MemviewEnum_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
10065 
10066  /* function exit code */
10067  __Pyx_RefNannyFinishContext();
10068  return __pyx_r;
10069 }
10070 
10071 static PyObject *__pyx_pf___pyx_MemviewEnum_2__setstate_cython__(struct __pyx_MemviewEnum_obj *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
10072  PyObject *__pyx_r = NULL;
10073  __Pyx_RefNannyDeclarations
10074  PyObject *__pyx_t_1 = NULL;
10075  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
10076 
10077  /* "(tree fragment)":15
10078  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10079  * def __setstate_cython__(self, __pyx_state):
10080  * __pyx_unpickle_Enum__set_state(self, __pyx_state) # <<<<<<<<<<<<<<
10081  */
10082  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 15, __pyx_L1_error)
10083  __pyx_t_1 = __pyx_unpickle_Enum__set_state(__pyx_v_self, ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 15, __pyx_L1_error)
10084  __Pyx_GOTREF(__pyx_t_1);
10085  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
10086 
10087  /* "(tree fragment)":14
10088  * else:
10089  * return __pyx_unpickle_Enum, (type(self), 0xb068931, state)
10090  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
10091  * __pyx_unpickle_Enum__set_state(self, __pyx_state)
10092  */
10093 
10094  /* function exit code */
10095  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
10096  goto __pyx_L0;
10097  __pyx_L1_error:;
10098  __Pyx_XDECREF(__pyx_t_1);
10099  __Pyx_AddTraceback("View.MemoryView.Enum.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10100  __pyx_r = NULL;
10101  __pyx_L0:;
10102  __Pyx_XGIVEREF(__pyx_r);
10103  __Pyx_RefNannyFinishContext();
10104  return __pyx_r;
10105 }
10106 
10107 /* "View.MemoryView":297
10108  *
10109  * @cname('__pyx_align_pointer')
10110  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10111  * "Align pointer memory on a given boundary"
10112  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10113  */
10114 
10115 static void *__pyx_align_pointer(void *__pyx_v_memory, size_t __pyx_v_alignment) {
10116  Py_intptr_t __pyx_v_aligned_p;
10117  size_t __pyx_v_offset;
10118  void *__pyx_r;
10119  int __pyx_t_1;
10120 
10121  /* "View.MemoryView":299
10122  * cdef void *align_pointer(void *memory, size_t alignment) nogil:
10123  * "Align pointer memory on a given boundary"
10124  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory # <<<<<<<<<<<<<<
10125  * cdef size_t offset
10126  *
10127  */
10128  __pyx_v_aligned_p = ((Py_intptr_t)__pyx_v_memory);
10129 
10130  /* "View.MemoryView":303
10131  *
10132  * with cython.cdivision(True):
10133  * offset = aligned_p % alignment # <<<<<<<<<<<<<<
10134  *
10135  * if offset > 0:
10136  */
10137  __pyx_v_offset = (__pyx_v_aligned_p % __pyx_v_alignment);
10138 
10139  /* "View.MemoryView":305
10140  * offset = aligned_p % alignment
10141  *
10142  * if offset > 0: # <<<<<<<<<<<<<<
10143  * aligned_p += alignment - offset
10144  *
10145  */
10146  __pyx_t_1 = ((__pyx_v_offset > 0) != 0);
10147  if (__pyx_t_1) {
10148 
10149  /* "View.MemoryView":306
10150  *
10151  * if offset > 0:
10152  * aligned_p += alignment - offset # <<<<<<<<<<<<<<
10153  *
10154  * return <void *> aligned_p
10155  */
10156  __pyx_v_aligned_p = (__pyx_v_aligned_p + (__pyx_v_alignment - __pyx_v_offset));
10157 
10158  /* "View.MemoryView":305
10159  * offset = aligned_p % alignment
10160  *
10161  * if offset > 0: # <<<<<<<<<<<<<<
10162  * aligned_p += alignment - offset
10163  *
10164  */
10165  }
10166 
10167  /* "View.MemoryView":308
10168  * aligned_p += alignment - offset
10169  *
10170  * return <void *> aligned_p # <<<<<<<<<<<<<<
10171  *
10172  *
10173  */
10174  __pyx_r = ((void *)__pyx_v_aligned_p);
10175  goto __pyx_L0;
10176 
10177  /* "View.MemoryView":297
10178  *
10179  * @cname('__pyx_align_pointer')
10180  * cdef void *align_pointer(void *memory, size_t alignment) nogil: # <<<<<<<<<<<<<<
10181  * "Align pointer memory on a given boundary"
10182  * cdef Py_intptr_t aligned_p = <Py_intptr_t> memory
10183  */
10184 
10185  /* function exit code */
10186  __pyx_L0:;
10187  return __pyx_r;
10188 }
10189 
10190 /* "View.MemoryView":344
10191  * cdef __Pyx_TypeInfo *typeinfo
10192  *
10193  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10194  * self.obj = obj
10195  * self.flags = flags
10196  */
10197 
10198 /* Python wrapper */
10199 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
10200 static int __pyx_memoryview___cinit__(PyObject *__pyx_v_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
10201  PyObject *__pyx_v_obj = 0;
10202  int __pyx_v_flags;
10203  int __pyx_v_dtype_is_object;
10204  int __pyx_r;
10205  __Pyx_RefNannyDeclarations
10206  __Pyx_RefNannySetupContext("__cinit__ (wrapper)", 0);
10207  {
10208  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_obj,&__pyx_n_s_flags,&__pyx_n_s_dtype_is_object,0};
10209  PyObject* values[3] = {0,0,0};
10210  if (unlikely(__pyx_kwds)) {
10211  Py_ssize_t kw_args;
10212  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
10213  switch (pos_args) {
10214  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10215  CYTHON_FALLTHROUGH;
10216  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10217  CYTHON_FALLTHROUGH;
10218  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10219  CYTHON_FALLTHROUGH;
10220  case 0: break;
10221  default: goto __pyx_L5_argtuple_error;
10222  }
10223  kw_args = PyDict_Size(__pyx_kwds);
10224  switch (pos_args) {
10225  case 0:
10226  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_obj)) != 0)) kw_args--;
10227  else goto __pyx_L5_argtuple_error;
10228  CYTHON_FALLTHROUGH;
10229  case 1:
10230  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_flags)) != 0)) kw_args--;
10231  else {
10232  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, 1); __PYX_ERR(0, 344, __pyx_L3_error)
10233  }
10234  CYTHON_FALLTHROUGH;
10235  case 2:
10236  if (kw_args > 0) {
10237  PyObject* value = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_dtype_is_object);
10238  if (value) { values[2] = value; kw_args--; }
10239  }
10240  }
10241  if (unlikely(kw_args > 0)) {
10242  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__cinit__") < 0)) __PYX_ERR(0, 344, __pyx_L3_error)
10243  }
10244  } else {
10245  switch (PyTuple_GET_SIZE(__pyx_args)) {
10246  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
10247  CYTHON_FALLTHROUGH;
10248  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
10249  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
10250  break;
10251  default: goto __pyx_L5_argtuple_error;
10252  }
10253  }
10254  __pyx_v_obj = values[0];
10255  __pyx_v_flags = __Pyx_PyInt_As_int(values[1]); if (unlikely((__pyx_v_flags == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error)
10256  if (values[2]) {
10257  __pyx_v_dtype_is_object = __Pyx_PyObject_IsTrue(values[2]); if (unlikely((__pyx_v_dtype_is_object == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 344, __pyx_L3_error)
10258  } else {
10259  __pyx_v_dtype_is_object = ((int)0);
10260  }
10261  }
10262  goto __pyx_L4_argument_unpacking_done;
10263  __pyx_L5_argtuple_error:;
10264  __Pyx_RaiseArgtupleInvalid("__cinit__", 0, 2, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 344, __pyx_L3_error)
10265  __pyx_L3_error:;
10266  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10267  __Pyx_RefNannyFinishContext();
10268  return -1;
10269  __pyx_L4_argument_unpacking_done:;
10270  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_obj, __pyx_v_flags, __pyx_v_dtype_is_object);
10271 
10272  /* function exit code */
10273  __Pyx_RefNannyFinishContext();
10274  return __pyx_r;
10275 }
10276 
10277 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview___cinit__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj, int __pyx_v_flags, int __pyx_v_dtype_is_object) {
10278  int __pyx_r;
10279  __Pyx_RefNannyDeclarations
10280  int __pyx_t_1;
10281  int __pyx_t_2;
10282  int __pyx_t_3;
10283  int __pyx_t_4;
10284  __Pyx_RefNannySetupContext("__cinit__", 0);
10285 
10286  /* "View.MemoryView":345
10287  *
10288  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10289  * self.obj = obj # <<<<<<<<<<<<<<
10290  * self.flags = flags
10291  * if type(self) is memoryview or obj is not None:
10292  */
10293  __Pyx_INCREF(__pyx_v_obj);
10294  __Pyx_GIVEREF(__pyx_v_obj);
10295  __Pyx_GOTREF(__pyx_v_self->obj);
10296  __Pyx_DECREF(__pyx_v_self->obj);
10297  __pyx_v_self->obj = __pyx_v_obj;
10298 
10299  /* "View.MemoryView":346
10300  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False):
10301  * self.obj = obj
10302  * self.flags = flags # <<<<<<<<<<<<<<
10303  * if type(self) is memoryview or obj is not None:
10304  * __Pyx_GetBuffer(obj, &self.view, flags)
10305  */
10306  __pyx_v_self->flags = __pyx_v_flags;
10307 
10308  /* "View.MemoryView":347
10309  * self.obj = obj
10310  * self.flags = flags
10311  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10312  * __Pyx_GetBuffer(obj, &self.view, flags)
10313  * if <PyObject *> self.view.obj == NULL:
10314  */
10315  __pyx_t_2 = (((PyObject *)Py_TYPE(((PyObject *)__pyx_v_self))) == ((PyObject *)__pyx_memoryview_type));
10316  __pyx_t_3 = (__pyx_t_2 != 0);
10317  if (!__pyx_t_3) {
10318  } else {
10319  __pyx_t_1 = __pyx_t_3;
10320  goto __pyx_L4_bool_binop_done;
10321  }
10322  __pyx_t_3 = (__pyx_v_obj != Py_None);
10323  __pyx_t_2 = (__pyx_t_3 != 0);
10324  __pyx_t_1 = __pyx_t_2;
10325  __pyx_L4_bool_binop_done:;
10326  if (__pyx_t_1) {
10327 
10328  /* "View.MemoryView":348
10329  * self.flags = flags
10330  * if type(self) is memoryview or obj is not None:
10331  * __Pyx_GetBuffer(obj, &self.view, flags) # <<<<<<<<<<<<<<
10332  * if <PyObject *> self.view.obj == NULL:
10333  * (<__pyx_buffer *> &self.view).obj = Py_None
10334  */
10335  __pyx_t_4 = __Pyx_GetBuffer(__pyx_v_obj, (&__pyx_v_self->view), __pyx_v_flags); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 348, __pyx_L1_error)
10336 
10337  /* "View.MemoryView":349
10338  * if type(self) is memoryview or obj is not None:
10339  * __Pyx_GetBuffer(obj, &self.view, flags)
10340  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10341  * (<__pyx_buffer *> &self.view).obj = Py_None
10342  * Py_INCREF(Py_None)
10343  */
10344  __pyx_t_1 = ((((PyObject *)__pyx_v_self->view.obj) == NULL) != 0);
10345  if (__pyx_t_1) {
10346 
10347  /* "View.MemoryView":350
10348  * __Pyx_GetBuffer(obj, &self.view, flags)
10349  * if <PyObject *> self.view.obj == NULL:
10350  * (<__pyx_buffer *> &self.view).obj = Py_None # <<<<<<<<<<<<<<
10351  * Py_INCREF(Py_None)
10352  *
10353  */
10354  ((Py_buffer *)(&__pyx_v_self->view))->obj = Py_None;
10355 
10356  /* "View.MemoryView":351
10357  * if <PyObject *> self.view.obj == NULL:
10358  * (<__pyx_buffer *> &self.view).obj = Py_None
10359  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
10360  *
10361  * global __pyx_memoryview_thread_locks_used
10362  */
10363  Py_INCREF(Py_None);
10364 
10365  /* "View.MemoryView":349
10366  * if type(self) is memoryview or obj is not None:
10367  * __Pyx_GetBuffer(obj, &self.view, flags)
10368  * if <PyObject *> self.view.obj == NULL: # <<<<<<<<<<<<<<
10369  * (<__pyx_buffer *> &self.view).obj = Py_None
10370  * Py_INCREF(Py_None)
10371  */
10372  }
10373 
10374  /* "View.MemoryView":347
10375  * self.obj = obj
10376  * self.flags = flags
10377  * if type(self) is memoryview or obj is not None: # <<<<<<<<<<<<<<
10378  * __Pyx_GetBuffer(obj, &self.view, flags)
10379  * if <PyObject *> self.view.obj == NULL:
10380  */
10381  }
10382 
10383  /* "View.MemoryView":354
10384  *
10385  * global __pyx_memoryview_thread_locks_used
10386  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10387  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10388  * __pyx_memoryview_thread_locks_used += 1
10389  */
10390  __pyx_t_1 = ((__pyx_memoryview_thread_locks_used < 8) != 0);
10391  if (__pyx_t_1) {
10392 
10393  /* "View.MemoryView":355
10394  * global __pyx_memoryview_thread_locks_used
10395  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10396  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] # <<<<<<<<<<<<<<
10397  * __pyx_memoryview_thread_locks_used += 1
10398  * if self.lock is NULL:
10399  */
10400  __pyx_v_self->lock = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10401 
10402  /* "View.MemoryView":356
10403  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED:
10404  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10405  * __pyx_memoryview_thread_locks_used += 1 # <<<<<<<<<<<<<<
10406  * if self.lock is NULL:
10407  * self.lock = PyThread_allocate_lock()
10408  */
10409  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used + 1);
10410 
10411  /* "View.MemoryView":354
10412  *
10413  * global __pyx_memoryview_thread_locks_used
10414  * if __pyx_memoryview_thread_locks_used < THREAD_LOCKS_PREALLOCATED: # <<<<<<<<<<<<<<
10415  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10416  * __pyx_memoryview_thread_locks_used += 1
10417  */
10418  }
10419 
10420  /* "View.MemoryView":357
10421  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10422  * __pyx_memoryview_thread_locks_used += 1
10423  * if self.lock is NULL: # <<<<<<<<<<<<<<
10424  * self.lock = PyThread_allocate_lock()
10425  * if self.lock is NULL:
10426  */
10427  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10428  if (__pyx_t_1) {
10429 
10430  /* "View.MemoryView":358
10431  * __pyx_memoryview_thread_locks_used += 1
10432  * if self.lock is NULL:
10433  * self.lock = PyThread_allocate_lock() # <<<<<<<<<<<<<<
10434  * if self.lock is NULL:
10435  * raise MemoryError
10436  */
10437  __pyx_v_self->lock = PyThread_allocate_lock();
10438 
10439  /* "View.MemoryView":359
10440  * if self.lock is NULL:
10441  * self.lock = PyThread_allocate_lock()
10442  * if self.lock is NULL: # <<<<<<<<<<<<<<
10443  * raise MemoryError
10444  *
10445  */
10446  __pyx_t_1 = ((__pyx_v_self->lock == NULL) != 0);
10447  if (unlikely(__pyx_t_1)) {
10448 
10449  /* "View.MemoryView":360
10450  * self.lock = PyThread_allocate_lock()
10451  * if self.lock is NULL:
10452  * raise MemoryError # <<<<<<<<<<<<<<
10453  *
10454  * if flags & PyBUF_FORMAT:
10455  */
10456  PyErr_NoMemory(); __PYX_ERR(0, 360, __pyx_L1_error)
10457 
10458  /* "View.MemoryView":359
10459  * if self.lock is NULL:
10460  * self.lock = PyThread_allocate_lock()
10461  * if self.lock is NULL: # <<<<<<<<<<<<<<
10462  * raise MemoryError
10463  *
10464  */
10465  }
10466 
10467  /* "View.MemoryView":357
10468  * self.lock = __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]
10469  * __pyx_memoryview_thread_locks_used += 1
10470  * if self.lock is NULL: # <<<<<<<<<<<<<<
10471  * self.lock = PyThread_allocate_lock()
10472  * if self.lock is NULL:
10473  */
10474  }
10475 
10476  /* "View.MemoryView":362
10477  * raise MemoryError
10478  *
10479  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10480  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10481  * else:
10482  */
10483  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
10484  if (__pyx_t_1) {
10485 
10486  /* "View.MemoryView":363
10487  *
10488  * if flags & PyBUF_FORMAT:
10489  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0') # <<<<<<<<<<<<<<
10490  * else:
10491  * self.dtype_is_object = dtype_is_object
10492  */
10493  __pyx_t_2 = (((__pyx_v_self->view.format[0]) == 'O') != 0);
10494  if (__pyx_t_2) {
10495  } else {
10496  __pyx_t_1 = __pyx_t_2;
10497  goto __pyx_L11_bool_binop_done;
10498  }
10499  __pyx_t_2 = (((__pyx_v_self->view.format[1]) == '\x00') != 0);
10500  __pyx_t_1 = __pyx_t_2;
10501  __pyx_L11_bool_binop_done:;
10502  __pyx_v_self->dtype_is_object = __pyx_t_1;
10503 
10504  /* "View.MemoryView":362
10505  * raise MemoryError
10506  *
10507  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
10508  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10509  * else:
10510  */
10511  goto __pyx_L10;
10512  }
10513 
10514  /* "View.MemoryView":365
10515  * self.dtype_is_object = (self.view.format[0] == b'O' and self.view.format[1] == b'\0')
10516  * else:
10517  * self.dtype_is_object = dtype_is_object # <<<<<<<<<<<<<<
10518  *
10519  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10520  */
10521  /*else*/ {
10522  __pyx_v_self->dtype_is_object = __pyx_v_dtype_is_object;
10523  }
10524  __pyx_L10:;
10525 
10526  /* "View.MemoryView":367
10527  * self.dtype_is_object = dtype_is_object
10528  *
10529  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer( # <<<<<<<<<<<<<<
10530  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10531  * self.typeinfo = NULL
10532  */
10533  __pyx_v_self->acquisition_count_aligned_p = ((__pyx_atomic_int *)__pyx_align_pointer(((void *)(&(__pyx_v_self->acquisition_count[0]))), (sizeof(__pyx_atomic_int))));
10534 
10535  /* "View.MemoryView":369
10536  * self.acquisition_count_aligned_p = <__pyx_atomic_int *> align_pointer(
10537  * <void *> &self.acquisition_count[0], sizeof(__pyx_atomic_int))
10538  * self.typeinfo = NULL # <<<<<<<<<<<<<<
10539  *
10540  * def __dealloc__(memoryview self):
10541  */
10542  __pyx_v_self->typeinfo = NULL;
10543 
10544  /* "View.MemoryView":344
10545  * cdef __Pyx_TypeInfo *typeinfo
10546  *
10547  * def __cinit__(memoryview self, object obj, int flags, bint dtype_is_object=False): # <<<<<<<<<<<<<<
10548  * self.obj = obj
10549  * self.flags = flags
10550  */
10551 
10552  /* function exit code */
10553  __pyx_r = 0;
10554  goto __pyx_L0;
10555  __pyx_L1_error:;
10556  __Pyx_AddTraceback("View.MemoryView.memoryview.__cinit__", __pyx_clineno, __pyx_lineno, __pyx_filename);
10557  __pyx_r = -1;
10558  __pyx_L0:;
10559  __Pyx_RefNannyFinishContext();
10560  return __pyx_r;
10561 }
10562 
10563 /* "View.MemoryView":371
10564  * self.typeinfo = NULL
10565  *
10566  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10567  * if self.obj is not None:
10568  * __Pyx_ReleaseBuffer(&self.view)
10569  */
10570 
10571 /* Python wrapper */
10572 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self); /*proto*/
10573 static void __pyx_memoryview___dealloc__(PyObject *__pyx_v_self) {
10574  __Pyx_RefNannyDeclarations
10575  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
10576  __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(((struct __pyx_memoryview_obj *)__pyx_v_self));
10577 
10578  /* function exit code */
10579  __Pyx_RefNannyFinishContext();
10580 }
10581 
10582 static void __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_2__dealloc__(struct __pyx_memoryview_obj *__pyx_v_self) {
10583  int __pyx_v_i;
10584  __Pyx_RefNannyDeclarations
10585  int __pyx_t_1;
10586  int __pyx_t_2;
10587  int __pyx_t_3;
10588  int __pyx_t_4;
10589  int __pyx_t_5;
10590  PyThread_type_lock __pyx_t_6;
10591  PyThread_type_lock __pyx_t_7;
10592  __Pyx_RefNannySetupContext("__dealloc__", 0);
10593 
10594  /* "View.MemoryView":372
10595  *
10596  * def __dealloc__(memoryview self):
10597  * if self.obj is not None: # <<<<<<<<<<<<<<
10598  * __Pyx_ReleaseBuffer(&self.view)
10599  *
10600  */
10601  __pyx_t_1 = (__pyx_v_self->obj != Py_None);
10602  __pyx_t_2 = (__pyx_t_1 != 0);
10603  if (__pyx_t_2) {
10604 
10605  /* "View.MemoryView":373
10606  * def __dealloc__(memoryview self):
10607  * if self.obj is not None:
10608  * __Pyx_ReleaseBuffer(&self.view) # <<<<<<<<<<<<<<
10609  *
10610  * cdef int i
10611  */
10612  __Pyx_ReleaseBuffer((&__pyx_v_self->view));
10613 
10614  /* "View.MemoryView":372
10615  *
10616  * def __dealloc__(memoryview self):
10617  * if self.obj is not None: # <<<<<<<<<<<<<<
10618  * __Pyx_ReleaseBuffer(&self.view)
10619  *
10620  */
10621  }
10622 
10623  /* "View.MemoryView":377
10624  * cdef int i
10625  * global __pyx_memoryview_thread_locks_used
10626  * if self.lock != NULL: # <<<<<<<<<<<<<<
10627  * for i in range(__pyx_memoryview_thread_locks_used):
10628  * if __pyx_memoryview_thread_locks[i] is self.lock:
10629  */
10630  __pyx_t_2 = ((__pyx_v_self->lock != NULL) != 0);
10631  if (__pyx_t_2) {
10632 
10633  /* "View.MemoryView":378
10634  * global __pyx_memoryview_thread_locks_used
10635  * if self.lock != NULL:
10636  * for i in range(__pyx_memoryview_thread_locks_used): # <<<<<<<<<<<<<<
10637  * if __pyx_memoryview_thread_locks[i] is self.lock:
10638  * __pyx_memoryview_thread_locks_used -= 1
10639  */
10640  __pyx_t_3 = __pyx_memoryview_thread_locks_used;
10641  __pyx_t_4 = __pyx_t_3;
10642  for (__pyx_t_5 = 0; __pyx_t_5 < __pyx_t_4; __pyx_t_5+=1) {
10643  __pyx_v_i = __pyx_t_5;
10644 
10645  /* "View.MemoryView":379
10646  * if self.lock != NULL:
10647  * for i in range(__pyx_memoryview_thread_locks_used):
10648  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10649  * __pyx_memoryview_thread_locks_used -= 1
10650  * if i != __pyx_memoryview_thread_locks_used:
10651  */
10652  __pyx_t_2 = (((__pyx_memoryview_thread_locks[__pyx_v_i]) == __pyx_v_self->lock) != 0);
10653  if (__pyx_t_2) {
10654 
10655  /* "View.MemoryView":380
10656  * for i in range(__pyx_memoryview_thread_locks_used):
10657  * if __pyx_memoryview_thread_locks[i] is self.lock:
10658  * __pyx_memoryview_thread_locks_used -= 1 # <<<<<<<<<<<<<<
10659  * if i != __pyx_memoryview_thread_locks_used:
10660  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10661  */
10662  __pyx_memoryview_thread_locks_used = (__pyx_memoryview_thread_locks_used - 1);
10663 
10664  /* "View.MemoryView":381
10665  * if __pyx_memoryview_thread_locks[i] is self.lock:
10666  * __pyx_memoryview_thread_locks_used -= 1
10667  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10668  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10669  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10670  */
10671  __pyx_t_2 = ((__pyx_v_i != __pyx_memoryview_thread_locks_used) != 0);
10672  if (__pyx_t_2) {
10673 
10674  /* "View.MemoryView":383
10675  * if i != __pyx_memoryview_thread_locks_used:
10676  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10677  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i]) # <<<<<<<<<<<<<<
10678  * break
10679  * else:
10680  */
10681  __pyx_t_6 = (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]);
10682  __pyx_t_7 = (__pyx_memoryview_thread_locks[__pyx_v_i]);
10683 
10684  /* "View.MemoryView":382
10685  * __pyx_memoryview_thread_locks_used -= 1
10686  * if i != __pyx_memoryview_thread_locks_used:
10687  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = ( # <<<<<<<<<<<<<<
10688  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10689  * break
10690  */
10691  (__pyx_memoryview_thread_locks[__pyx_v_i]) = __pyx_t_6;
10692  (__pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used]) = __pyx_t_7;
10693 
10694  /* "View.MemoryView":381
10695  * if __pyx_memoryview_thread_locks[i] is self.lock:
10696  * __pyx_memoryview_thread_locks_used -= 1
10697  * if i != __pyx_memoryview_thread_locks_used: # <<<<<<<<<<<<<<
10698  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10699  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10700  */
10701  }
10702 
10703  /* "View.MemoryView":384
10704  * __pyx_memoryview_thread_locks[i], __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used] = (
10705  * __pyx_memoryview_thread_locks[__pyx_memoryview_thread_locks_used], __pyx_memoryview_thread_locks[i])
10706  * break # <<<<<<<<<<<<<<
10707  * else:
10708  * PyThread_free_lock(self.lock)
10709  */
10710  goto __pyx_L6_break;
10711 
10712  /* "View.MemoryView":379
10713  * if self.lock != NULL:
10714  * for i in range(__pyx_memoryview_thread_locks_used):
10715  * if __pyx_memoryview_thread_locks[i] is self.lock: # <<<<<<<<<<<<<<
10716  * __pyx_memoryview_thread_locks_used -= 1
10717  * if i != __pyx_memoryview_thread_locks_used:
10718  */
10719  }
10720  }
10721  /*else*/ {
10722 
10723  /* "View.MemoryView":386
10724  * break
10725  * else:
10726  * PyThread_free_lock(self.lock) # <<<<<<<<<<<<<<
10727  *
10728  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10729  */
10730  PyThread_free_lock(__pyx_v_self->lock);
10731  }
10732  __pyx_L6_break:;
10733 
10734  /* "View.MemoryView":377
10735  * cdef int i
10736  * global __pyx_memoryview_thread_locks_used
10737  * if self.lock != NULL: # <<<<<<<<<<<<<<
10738  * for i in range(__pyx_memoryview_thread_locks_used):
10739  * if __pyx_memoryview_thread_locks[i] is self.lock:
10740  */
10741  }
10742 
10743  /* "View.MemoryView":371
10744  * self.typeinfo = NULL
10745  *
10746  * def __dealloc__(memoryview self): # <<<<<<<<<<<<<<
10747  * if self.obj is not None:
10748  * __Pyx_ReleaseBuffer(&self.view)
10749  */
10750 
10751  /* function exit code */
10752  __Pyx_RefNannyFinishContext();
10753 }
10754 
10755 /* "View.MemoryView":388
10756  * PyThread_free_lock(self.lock)
10757  *
10758  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10759  * cdef Py_ssize_t dim
10760  * cdef char *itemp = <char *> self.view.buf
10761  */
10762 
10763 static char *__pyx_memoryview_get_item_pointer(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10764  Py_ssize_t __pyx_v_dim;
10765  char *__pyx_v_itemp;
10766  PyObject *__pyx_v_idx = NULL;
10767  char *__pyx_r;
10768  __Pyx_RefNannyDeclarations
10769  Py_ssize_t __pyx_t_1;
10770  PyObject *__pyx_t_2 = NULL;
10771  Py_ssize_t __pyx_t_3;
10772  PyObject *(*__pyx_t_4)(PyObject *);
10773  PyObject *__pyx_t_5 = NULL;
10774  Py_ssize_t __pyx_t_6;
10775  char *__pyx_t_7;
10776  __Pyx_RefNannySetupContext("get_item_pointer", 0);
10777 
10778  /* "View.MemoryView":390
10779  * cdef char *get_item_pointer(memoryview self, object index) except NULL:
10780  * cdef Py_ssize_t dim
10781  * cdef char *itemp = <char *> self.view.buf # <<<<<<<<<<<<<<
10782  *
10783  * for dim, idx in enumerate(index):
10784  */
10785  __pyx_v_itemp = ((char *)__pyx_v_self->view.buf);
10786 
10787  /* "View.MemoryView":392
10788  * cdef char *itemp = <char *> self.view.buf
10789  *
10790  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10791  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10792  *
10793  */
10794  __pyx_t_1 = 0;
10795  if (likely(PyList_CheckExact(__pyx_v_index)) || PyTuple_CheckExact(__pyx_v_index)) {
10796  __pyx_t_2 = __pyx_v_index; __Pyx_INCREF(__pyx_t_2); __pyx_t_3 = 0;
10797  __pyx_t_4 = NULL;
10798  } else {
10799  __pyx_t_3 = -1; __pyx_t_2 = PyObject_GetIter(__pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 392, __pyx_L1_error)
10800  __Pyx_GOTREF(__pyx_t_2);
10801  __pyx_t_4 = Py_TYPE(__pyx_t_2)->tp_iternext; if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 392, __pyx_L1_error)
10802  }
10803  for (;;) {
10804  if (likely(!__pyx_t_4)) {
10805  if (likely(PyList_CheckExact(__pyx_t_2))) {
10806  if (__pyx_t_3 >= PyList_GET_SIZE(__pyx_t_2)) break;
10807  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10808  __pyx_t_5 = PyList_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
10809  #else
10810  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
10811  __Pyx_GOTREF(__pyx_t_5);
10812  #endif
10813  } else {
10814  if (__pyx_t_3 >= PyTuple_GET_SIZE(__pyx_t_2)) break;
10815  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10816  __pyx_t_5 = PyTuple_GET_ITEM(__pyx_t_2, __pyx_t_3); __Pyx_INCREF(__pyx_t_5); __pyx_t_3++; if (unlikely(0 < 0)) __PYX_ERR(0, 392, __pyx_L1_error)
10817  #else
10818  __pyx_t_5 = PySequence_ITEM(__pyx_t_2, __pyx_t_3); __pyx_t_3++; if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 392, __pyx_L1_error)
10819  __Pyx_GOTREF(__pyx_t_5);
10820  #endif
10821  }
10822  } else {
10823  __pyx_t_5 = __pyx_t_4(__pyx_t_2);
10824  if (unlikely(!__pyx_t_5)) {
10825  PyObject* exc_type = PyErr_Occurred();
10826  if (exc_type) {
10827  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
10828  else __PYX_ERR(0, 392, __pyx_L1_error)
10829  }
10830  break;
10831  }
10832  __Pyx_GOTREF(__pyx_t_5);
10833  }
10834  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_5);
10835  __pyx_t_5 = 0;
10836  __pyx_v_dim = __pyx_t_1;
10837  __pyx_t_1 = (__pyx_t_1 + 1);
10838 
10839  /* "View.MemoryView":393
10840  *
10841  * for dim, idx in enumerate(index):
10842  * itemp = pybuffer_index(&self.view, itemp, idx, dim) # <<<<<<<<<<<<<<
10843  *
10844  * return itemp
10845  */
10846  __pyx_t_6 = __Pyx_PyIndex_AsSsize_t(__pyx_v_idx); if (unlikely((__pyx_t_6 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 393, __pyx_L1_error)
10847  __pyx_t_7 = __pyx_pybuffer_index((&__pyx_v_self->view), __pyx_v_itemp, __pyx_t_6, __pyx_v_dim); if (unlikely(__pyx_t_7 == ((char *)NULL))) __PYX_ERR(0, 393, __pyx_L1_error)
10848  __pyx_v_itemp = __pyx_t_7;
10849 
10850  /* "View.MemoryView":392
10851  * cdef char *itemp = <char *> self.view.buf
10852  *
10853  * for dim, idx in enumerate(index): # <<<<<<<<<<<<<<
10854  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10855  *
10856  */
10857  }
10858  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
10859 
10860  /* "View.MemoryView":395
10861  * itemp = pybuffer_index(&self.view, itemp, idx, dim)
10862  *
10863  * return itemp # <<<<<<<<<<<<<<
10864  *
10865  *
10866  */
10867  __pyx_r = __pyx_v_itemp;
10868  goto __pyx_L0;
10869 
10870  /* "View.MemoryView":388
10871  * PyThread_free_lock(self.lock)
10872  *
10873  * cdef char *get_item_pointer(memoryview self, object index) except NULL: # <<<<<<<<<<<<<<
10874  * cdef Py_ssize_t dim
10875  * cdef char *itemp = <char *> self.view.buf
10876  */
10877 
10878  /* function exit code */
10879  __pyx_L1_error:;
10880  __Pyx_XDECREF(__pyx_t_2);
10881  __Pyx_XDECREF(__pyx_t_5);
10882  __Pyx_AddTraceback("View.MemoryView.memoryview.get_item_pointer", __pyx_clineno, __pyx_lineno, __pyx_filename);
10883  __pyx_r = NULL;
10884  __pyx_L0:;
10885  __Pyx_XDECREF(__pyx_v_idx);
10886  __Pyx_RefNannyFinishContext();
10887  return __pyx_r;
10888 }
10889 
10890 /* "View.MemoryView":398
10891  *
10892  *
10893  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
10894  * if index is Ellipsis:
10895  * return self
10896  */
10897 
10898 /* Python wrapper */
10899 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index); /*proto*/
10900 static PyObject *__pyx_memoryview___getitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index) {
10901  PyObject *__pyx_r = 0;
10902  __Pyx_RefNannyDeclarations
10903  __Pyx_RefNannySetupContext("__getitem__ (wrapper)", 0);
10904  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index));
10905 
10906  /* function exit code */
10907  __Pyx_RefNannyFinishContext();
10908  return __pyx_r;
10909 }
10910 
10911 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_4__getitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index) {
10912  PyObject *__pyx_v_have_slices = NULL;
10913  PyObject *__pyx_v_indices = NULL;
10914  char *__pyx_v_itemp;
10915  PyObject *__pyx_r = NULL;
10916  __Pyx_RefNannyDeclarations
10917  int __pyx_t_1;
10918  int __pyx_t_2;
10919  PyObject *__pyx_t_3 = NULL;
10920  PyObject *__pyx_t_4 = NULL;
10921  PyObject *__pyx_t_5 = NULL;
10922  char *__pyx_t_6;
10923  __Pyx_RefNannySetupContext("__getitem__", 0);
10924 
10925  /* "View.MemoryView":399
10926  *
10927  * def __getitem__(memoryview self, object index):
10928  * if index is Ellipsis: # <<<<<<<<<<<<<<
10929  * return self
10930  *
10931  */
10932  __pyx_t_1 = (__pyx_v_index == __pyx_builtin_Ellipsis);
10933  __pyx_t_2 = (__pyx_t_1 != 0);
10934  if (__pyx_t_2) {
10935 
10936  /* "View.MemoryView":400
10937  * def __getitem__(memoryview self, object index):
10938  * if index is Ellipsis:
10939  * return self # <<<<<<<<<<<<<<
10940  *
10941  * have_slices, indices = _unellipsify(index, self.view.ndim)
10942  */
10943  __Pyx_XDECREF(__pyx_r);
10944  __Pyx_INCREF(((PyObject *)__pyx_v_self));
10945  __pyx_r = ((PyObject *)__pyx_v_self);
10946  goto __pyx_L0;
10947 
10948  /* "View.MemoryView":399
10949  *
10950  * def __getitem__(memoryview self, object index):
10951  * if index is Ellipsis: # <<<<<<<<<<<<<<
10952  * return self
10953  *
10954  */
10955  }
10956 
10957  /* "View.MemoryView":402
10958  * return self
10959  *
10960  * have_slices, indices = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
10961  *
10962  * cdef char *itemp
10963  */
10964  __pyx_t_3 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 402, __pyx_L1_error)
10965  __Pyx_GOTREF(__pyx_t_3);
10966  if (likely(__pyx_t_3 != Py_None)) {
10967  PyObject* sequence = __pyx_t_3;
10968  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
10969  if (unlikely(size != 2)) {
10970  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
10971  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
10972  __PYX_ERR(0, 402, __pyx_L1_error)
10973  }
10974  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
10975  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 0);
10976  __pyx_t_5 = PyTuple_GET_ITEM(sequence, 1);
10977  __Pyx_INCREF(__pyx_t_4);
10978  __Pyx_INCREF(__pyx_t_5);
10979  #else
10980  __pyx_t_4 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 402, __pyx_L1_error)
10981  __Pyx_GOTREF(__pyx_t_4);
10982  __pyx_t_5 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 402, __pyx_L1_error)
10983  __Pyx_GOTREF(__pyx_t_5);
10984  #endif
10985  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
10986  } else {
10987  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 402, __pyx_L1_error)
10988  }
10989  __pyx_v_have_slices = __pyx_t_4;
10990  __pyx_t_4 = 0;
10991  __pyx_v_indices = __pyx_t_5;
10992  __pyx_t_5 = 0;
10993 
10994  /* "View.MemoryView":405
10995  *
10996  * cdef char *itemp
10997  * if have_slices: # <<<<<<<<<<<<<<
10998  * return memview_slice(self, indices)
10999  * else:
11000  */
11001  __pyx_t_2 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_2 < 0)) __PYX_ERR(0, 405, __pyx_L1_error)
11002  if (__pyx_t_2) {
11003 
11004  /* "View.MemoryView":406
11005  * cdef char *itemp
11006  * if have_slices:
11007  * return memview_slice(self, indices) # <<<<<<<<<<<<<<
11008  * else:
11009  * itemp = self.get_item_pointer(indices)
11010  */
11011  __Pyx_XDECREF(__pyx_r);
11012  __pyx_t_3 = ((PyObject *)__pyx_memview_slice(__pyx_v_self, __pyx_v_indices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 406, __pyx_L1_error)
11013  __Pyx_GOTREF(__pyx_t_3);
11014  __pyx_r = __pyx_t_3;
11015  __pyx_t_3 = 0;
11016  goto __pyx_L0;
11017 
11018  /* "View.MemoryView":405
11019  *
11020  * cdef char *itemp
11021  * if have_slices: # <<<<<<<<<<<<<<
11022  * return memview_slice(self, indices)
11023  * else:
11024  */
11025  }
11026 
11027  /* "View.MemoryView":408
11028  * return memview_slice(self, indices)
11029  * else:
11030  * itemp = self.get_item_pointer(indices) # <<<<<<<<<<<<<<
11031  * return self.convert_item_to_object(itemp)
11032  *
11033  */
11034  /*else*/ {
11035  __pyx_t_6 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_indices); if (unlikely(__pyx_t_6 == ((char *)NULL))) __PYX_ERR(0, 408, __pyx_L1_error)
11036  __pyx_v_itemp = __pyx_t_6;
11037 
11038  /* "View.MemoryView":409
11039  * else:
11040  * itemp = self.get_item_pointer(indices)
11041  * return self.convert_item_to_object(itemp) # <<<<<<<<<<<<<<
11042  *
11043  * def __setitem__(memoryview self, object index, object value):
11044  */
11045  __Pyx_XDECREF(__pyx_r);
11046  __pyx_t_3 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->convert_item_to_object(__pyx_v_self, __pyx_v_itemp); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 409, __pyx_L1_error)
11047  __Pyx_GOTREF(__pyx_t_3);
11048  __pyx_r = __pyx_t_3;
11049  __pyx_t_3 = 0;
11050  goto __pyx_L0;
11051  }
11052 
11053  /* "View.MemoryView":398
11054  *
11055  *
11056  * def __getitem__(memoryview self, object index): # <<<<<<<<<<<<<<
11057  * if index is Ellipsis:
11058  * return self
11059  */
11060 
11061  /* function exit code */
11062  __pyx_L1_error:;
11063  __Pyx_XDECREF(__pyx_t_3);
11064  __Pyx_XDECREF(__pyx_t_4);
11065  __Pyx_XDECREF(__pyx_t_5);
11066  __Pyx_AddTraceback("View.MemoryView.memoryview.__getitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11067  __pyx_r = NULL;
11068  __pyx_L0:;
11069  __Pyx_XDECREF(__pyx_v_have_slices);
11070  __Pyx_XDECREF(__pyx_v_indices);
11071  __Pyx_XGIVEREF(__pyx_r);
11072  __Pyx_RefNannyFinishContext();
11073  return __pyx_r;
11074 }
11075 
11076 /* "View.MemoryView":411
11077  * return self.convert_item_to_object(itemp)
11078  *
11079  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11080  * if self.view.readonly:
11081  * raise TypeError("Cannot assign to read-only memoryview")
11082  */
11083 
11084 /* Python wrapper */
11085 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value); /*proto*/
11086 static int __pyx_memoryview___setitem__(PyObject *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11087  int __pyx_r;
11088  __Pyx_RefNannyDeclarations
11089  __Pyx_RefNannySetupContext("__setitem__ (wrapper)", 0);
11090  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v_index), ((PyObject *)__pyx_v_value));
11091 
11092  /* function exit code */
11093  __Pyx_RefNannyFinishContext();
11094  return __pyx_r;
11095 }
11096 
11097 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_6__setitem__(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11098  PyObject *__pyx_v_have_slices = NULL;
11099  PyObject *__pyx_v_obj = NULL;
11100  int __pyx_r;
11101  __Pyx_RefNannyDeclarations
11102  int __pyx_t_1;
11103  PyObject *__pyx_t_2 = NULL;
11104  PyObject *__pyx_t_3 = NULL;
11105  PyObject *__pyx_t_4 = NULL;
11106  __Pyx_RefNannySetupContext("__setitem__", 0);
11107  __Pyx_INCREF(__pyx_v_index);
11108 
11109  /* "View.MemoryView":412
11110  *
11111  * def __setitem__(memoryview self, object index, object value):
11112  * if self.view.readonly: # <<<<<<<<<<<<<<
11113  * raise TypeError("Cannot assign to read-only memoryview")
11114  *
11115  */
11116  __pyx_t_1 = (__pyx_v_self->view.readonly != 0);
11117  if (unlikely(__pyx_t_1)) {
11118 
11119  /* "View.MemoryView":413
11120  * def __setitem__(memoryview self, object index, object value):
11121  * if self.view.readonly:
11122  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
11123  *
11124  * have_slices, index = _unellipsify(index, self.view.ndim)
11125  */
11126  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__20, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 413, __pyx_L1_error)
11127  __Pyx_GOTREF(__pyx_t_2);
11128  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
11129  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11130  __PYX_ERR(0, 413, __pyx_L1_error)
11131 
11132  /* "View.MemoryView":412
11133  *
11134  * def __setitem__(memoryview self, object index, object value):
11135  * if self.view.readonly: # <<<<<<<<<<<<<<
11136  * raise TypeError("Cannot assign to read-only memoryview")
11137  *
11138  */
11139  }
11140 
11141  /* "View.MemoryView":415
11142  * raise TypeError("Cannot assign to read-only memoryview")
11143  *
11144  * have_slices, index = _unellipsify(index, self.view.ndim) # <<<<<<<<<<<<<<
11145  *
11146  * if have_slices:
11147  */
11148  __pyx_t_2 = _unellipsify(__pyx_v_index, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 415, __pyx_L1_error)
11149  __Pyx_GOTREF(__pyx_t_2);
11150  if (likely(__pyx_t_2 != Py_None)) {
11151  PyObject* sequence = __pyx_t_2;
11152  Py_ssize_t size = __Pyx_PySequence_SIZE(sequence);
11153  if (unlikely(size != 2)) {
11154  if (size > 2) __Pyx_RaiseTooManyValuesError(2);
11155  else if (size >= 0) __Pyx_RaiseNeedMoreValuesError(size);
11156  __PYX_ERR(0, 415, __pyx_L1_error)
11157  }
11158  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
11159  __pyx_t_3 = PyTuple_GET_ITEM(sequence, 0);
11160  __pyx_t_4 = PyTuple_GET_ITEM(sequence, 1);
11161  __Pyx_INCREF(__pyx_t_3);
11162  __Pyx_INCREF(__pyx_t_4);
11163  #else
11164  __pyx_t_3 = PySequence_ITEM(sequence, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 415, __pyx_L1_error)
11165  __Pyx_GOTREF(__pyx_t_3);
11166  __pyx_t_4 = PySequence_ITEM(sequence, 1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 415, __pyx_L1_error)
11167  __Pyx_GOTREF(__pyx_t_4);
11168  #endif
11169  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11170  } else {
11171  __Pyx_RaiseNoneNotIterableError(); __PYX_ERR(0, 415, __pyx_L1_error)
11172  }
11173  __pyx_v_have_slices = __pyx_t_3;
11174  __pyx_t_3 = 0;
11175  __Pyx_DECREF_SET(__pyx_v_index, __pyx_t_4);
11176  __pyx_t_4 = 0;
11177 
11178  /* "View.MemoryView":417
11179  * have_slices, index = _unellipsify(index, self.view.ndim)
11180  *
11181  * if have_slices: # <<<<<<<<<<<<<<
11182  * obj = self.is_slice(value)
11183  * if obj:
11184  */
11185  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_have_slices); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 417, __pyx_L1_error)
11186  if (__pyx_t_1) {
11187 
11188  /* "View.MemoryView":418
11189  *
11190  * if have_slices:
11191  * obj = self.is_slice(value) # <<<<<<<<<<<<<<
11192  * if obj:
11193  * self.setitem_slice_assignment(self[index], obj)
11194  */
11195  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->is_slice(__pyx_v_self, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 418, __pyx_L1_error)
11196  __Pyx_GOTREF(__pyx_t_2);
11197  __pyx_v_obj = __pyx_t_2;
11198  __pyx_t_2 = 0;
11199 
11200  /* "View.MemoryView":419
11201  * if have_slices:
11202  * obj = self.is_slice(value)
11203  * if obj: # <<<<<<<<<<<<<<
11204  * self.setitem_slice_assignment(self[index], obj)
11205  * else:
11206  */
11207  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_v_obj); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 419, __pyx_L1_error)
11208  if (__pyx_t_1) {
11209 
11210  /* "View.MemoryView":420
11211  * obj = self.is_slice(value)
11212  * if obj:
11213  * self.setitem_slice_assignment(self[index], obj) # <<<<<<<<<<<<<<
11214  * else:
11215  * self.setitem_slice_assign_scalar(self[index], value)
11216  */
11217  __pyx_t_2 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 420, __pyx_L1_error)
11218  __Pyx_GOTREF(__pyx_t_2);
11219  __pyx_t_4 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assignment(__pyx_v_self, __pyx_t_2, __pyx_v_obj); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 420, __pyx_L1_error)
11220  __Pyx_GOTREF(__pyx_t_4);
11221  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11222  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11223 
11224  /* "View.MemoryView":419
11225  * if have_slices:
11226  * obj = self.is_slice(value)
11227  * if obj: # <<<<<<<<<<<<<<
11228  * self.setitem_slice_assignment(self[index], obj)
11229  * else:
11230  */
11231  goto __pyx_L5;
11232  }
11233 
11234  /* "View.MemoryView":422
11235  * self.setitem_slice_assignment(self[index], obj)
11236  * else:
11237  * self.setitem_slice_assign_scalar(self[index], value) # <<<<<<<<<<<<<<
11238  * else:
11239  * self.setitem_indexed(index, value)
11240  */
11241  /*else*/ {
11242  __pyx_t_4 = __Pyx_PyObject_GetItem(((PyObject *)__pyx_v_self), __pyx_v_index); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 422, __pyx_L1_error)
11243  __Pyx_GOTREF(__pyx_t_4);
11244  if (!(likely(((__pyx_t_4) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_4, __pyx_memoryview_type))))) __PYX_ERR(0, 422, __pyx_L1_error)
11245  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_slice_assign_scalar(__pyx_v_self, ((struct __pyx_memoryview_obj *)__pyx_t_4), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 422, __pyx_L1_error)
11246  __Pyx_GOTREF(__pyx_t_2);
11247  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
11248  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11249  }
11250  __pyx_L5:;
11251 
11252  /* "View.MemoryView":417
11253  * have_slices, index = _unellipsify(index, self.view.ndim)
11254  *
11255  * if have_slices: # <<<<<<<<<<<<<<
11256  * obj = self.is_slice(value)
11257  * if obj:
11258  */
11259  goto __pyx_L4;
11260  }
11261 
11262  /* "View.MemoryView":424
11263  * self.setitem_slice_assign_scalar(self[index], value)
11264  * else:
11265  * self.setitem_indexed(index, value) # <<<<<<<<<<<<<<
11266  *
11267  * cdef is_slice(self, obj):
11268  */
11269  /*else*/ {
11270  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->setitem_indexed(__pyx_v_self, __pyx_v_index, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 424, __pyx_L1_error)
11271  __Pyx_GOTREF(__pyx_t_2);
11272  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11273  }
11274  __pyx_L4:;
11275 
11276  /* "View.MemoryView":411
11277  * return self.convert_item_to_object(itemp)
11278  *
11279  * def __setitem__(memoryview self, object index, object value): # <<<<<<<<<<<<<<
11280  * if self.view.readonly:
11281  * raise TypeError("Cannot assign to read-only memoryview")
11282  */
11283 
11284  /* function exit code */
11285  __pyx_r = 0;
11286  goto __pyx_L0;
11287  __pyx_L1_error:;
11288  __Pyx_XDECREF(__pyx_t_2);
11289  __Pyx_XDECREF(__pyx_t_3);
11290  __Pyx_XDECREF(__pyx_t_4);
11291  __Pyx_AddTraceback("View.MemoryView.memoryview.__setitem__", __pyx_clineno, __pyx_lineno, __pyx_filename);
11292  __pyx_r = -1;
11293  __pyx_L0:;
11294  __Pyx_XDECREF(__pyx_v_have_slices);
11295  __Pyx_XDECREF(__pyx_v_obj);
11296  __Pyx_XDECREF(__pyx_v_index);
11297  __Pyx_RefNannyFinishContext();
11298  return __pyx_r;
11299 }
11300 
11301 /* "View.MemoryView":426
11302  * self.setitem_indexed(index, value)
11303  *
11304  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11305  * if not isinstance(obj, memoryview):
11306  * try:
11307  */
11308 
11309 static PyObject *__pyx_memoryview_is_slice(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_obj) {
11310  PyObject *__pyx_r = NULL;
11311  __Pyx_RefNannyDeclarations
11312  int __pyx_t_1;
11313  int __pyx_t_2;
11314  PyObject *__pyx_t_3 = NULL;
11315  PyObject *__pyx_t_4 = NULL;
11316  PyObject *__pyx_t_5 = NULL;
11317  PyObject *__pyx_t_6 = NULL;
11318  PyObject *__pyx_t_7 = NULL;
11319  PyObject *__pyx_t_8 = NULL;
11320  int __pyx_t_9;
11321  __Pyx_RefNannySetupContext("is_slice", 0);
11322  __Pyx_INCREF(__pyx_v_obj);
11323 
11324  /* "View.MemoryView":427
11325  *
11326  * cdef is_slice(self, obj):
11327  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11328  * try:
11329  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11330  */
11331  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_obj, __pyx_memoryview_type);
11332  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
11333  if (__pyx_t_2) {
11334 
11335  /* "View.MemoryView":428
11336  * cdef is_slice(self, obj):
11337  * if not isinstance(obj, memoryview):
11338  * try: # <<<<<<<<<<<<<<
11339  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11340  * self.dtype_is_object)
11341  */
11342  {
11343  __Pyx_PyThreadState_declare
11344  __Pyx_PyThreadState_assign
11345  __Pyx_ExceptionSave(&__pyx_t_3, &__pyx_t_4, &__pyx_t_5);
11346  __Pyx_XGOTREF(__pyx_t_3);
11347  __Pyx_XGOTREF(__pyx_t_4);
11348  __Pyx_XGOTREF(__pyx_t_5);
11349  /*try:*/ {
11350 
11351  /* "View.MemoryView":429
11352  * if not isinstance(obj, memoryview):
11353  * try:
11354  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11355  * self.dtype_is_object)
11356  * except TypeError:
11357  */
11358  __pyx_t_6 = __Pyx_PyInt_From_int((__pyx_v_self->flags | PyBUF_ANY_CONTIGUOUS)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 429, __pyx_L4_error)
11359  __Pyx_GOTREF(__pyx_t_6);
11360 
11361  /* "View.MemoryView":430
11362  * try:
11363  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11364  * self.dtype_is_object) # <<<<<<<<<<<<<<
11365  * except TypeError:
11366  * return None
11367  */
11368  __pyx_t_7 = __Pyx_PyBool_FromLong(__pyx_v_self->dtype_is_object); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 430, __pyx_L4_error)
11369  __Pyx_GOTREF(__pyx_t_7);
11370 
11371  /* "View.MemoryView":429
11372  * if not isinstance(obj, memoryview):
11373  * try:
11374  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS, # <<<<<<<<<<<<<<
11375  * self.dtype_is_object)
11376  * except TypeError:
11377  */
11378  __pyx_t_8 = PyTuple_New(3); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 429, __pyx_L4_error)
11379  __Pyx_GOTREF(__pyx_t_8);
11380  __Pyx_INCREF(__pyx_v_obj);
11381  __Pyx_GIVEREF(__pyx_v_obj);
11382  PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_v_obj);
11383  __Pyx_GIVEREF(__pyx_t_6);
11384  PyTuple_SET_ITEM(__pyx_t_8, 1, __pyx_t_6);
11385  __Pyx_GIVEREF(__pyx_t_7);
11386  PyTuple_SET_ITEM(__pyx_t_8, 2, __pyx_t_7);
11387  __pyx_t_6 = 0;
11388  __pyx_t_7 = 0;
11389  __pyx_t_7 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_8, NULL); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 429, __pyx_L4_error)
11390  __Pyx_GOTREF(__pyx_t_7);
11391  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11392  __Pyx_DECREF_SET(__pyx_v_obj, __pyx_t_7);
11393  __pyx_t_7 = 0;
11394 
11395  /* "View.MemoryView":428
11396  * cdef is_slice(self, obj):
11397  * if not isinstance(obj, memoryview):
11398  * try: # <<<<<<<<<<<<<<
11399  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11400  * self.dtype_is_object)
11401  */
11402  }
11403  __Pyx_XDECREF(__pyx_t_3); __pyx_t_3 = 0;
11404  __Pyx_XDECREF(__pyx_t_4); __pyx_t_4 = 0;
11405  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
11406  goto __pyx_L9_try_end;
11407  __pyx_L4_error:;
11408  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
11409  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
11410  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
11411 
11412  /* "View.MemoryView":431
11413  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11414  * self.dtype_is_object)
11415  * except TypeError: # <<<<<<<<<<<<<<
11416  * return None
11417  *
11418  */
11419  __pyx_t_9 = __Pyx_PyErr_ExceptionMatches(__pyx_builtin_TypeError);
11420  if (__pyx_t_9) {
11421  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11422  if (__Pyx_GetException(&__pyx_t_7, &__pyx_t_8, &__pyx_t_6) < 0) __PYX_ERR(0, 431, __pyx_L6_except_error)
11423  __Pyx_GOTREF(__pyx_t_7);
11424  __Pyx_GOTREF(__pyx_t_8);
11425  __Pyx_GOTREF(__pyx_t_6);
11426 
11427  /* "View.MemoryView":432
11428  * self.dtype_is_object)
11429  * except TypeError:
11430  * return None # <<<<<<<<<<<<<<
11431  *
11432  * return obj
11433  */
11434  __Pyx_XDECREF(__pyx_r);
11435  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11436  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
11437  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
11438  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
11439  goto __pyx_L7_except_return;
11440  }
11441  goto __pyx_L6_except_error;
11442  __pyx_L6_except_error:;
11443 
11444  /* "View.MemoryView":428
11445  * cdef is_slice(self, obj):
11446  * if not isinstance(obj, memoryview):
11447  * try: # <<<<<<<<<<<<<<
11448  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11449  * self.dtype_is_object)
11450  */
11451  __Pyx_XGIVEREF(__pyx_t_3);
11452  __Pyx_XGIVEREF(__pyx_t_4);
11453  __Pyx_XGIVEREF(__pyx_t_5);
11454  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11455  goto __pyx_L1_error;
11456  __pyx_L7_except_return:;
11457  __Pyx_XGIVEREF(__pyx_t_3);
11458  __Pyx_XGIVEREF(__pyx_t_4);
11459  __Pyx_XGIVEREF(__pyx_t_5);
11460  __Pyx_ExceptionReset(__pyx_t_3, __pyx_t_4, __pyx_t_5);
11461  goto __pyx_L0;
11462  __pyx_L9_try_end:;
11463  }
11464 
11465  /* "View.MemoryView":427
11466  *
11467  * cdef is_slice(self, obj):
11468  * if not isinstance(obj, memoryview): # <<<<<<<<<<<<<<
11469  * try:
11470  * obj = memoryview(obj, self.flags|PyBUF_ANY_CONTIGUOUS,
11471  */
11472  }
11473 
11474  /* "View.MemoryView":434
11475  * return None
11476  *
11477  * return obj # <<<<<<<<<<<<<<
11478  *
11479  * cdef setitem_slice_assignment(self, dst, src):
11480  */
11481  __Pyx_XDECREF(__pyx_r);
11482  __Pyx_INCREF(__pyx_v_obj);
11483  __pyx_r = __pyx_v_obj;
11484  goto __pyx_L0;
11485 
11486  /* "View.MemoryView":426
11487  * self.setitem_indexed(index, value)
11488  *
11489  * cdef is_slice(self, obj): # <<<<<<<<<<<<<<
11490  * if not isinstance(obj, memoryview):
11491  * try:
11492  */
11493 
11494  /* function exit code */
11495  __pyx_L1_error:;
11496  __Pyx_XDECREF(__pyx_t_6);
11497  __Pyx_XDECREF(__pyx_t_7);
11498  __Pyx_XDECREF(__pyx_t_8);
11499  __Pyx_AddTraceback("View.MemoryView.memoryview.is_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
11500  __pyx_r = 0;
11501  __pyx_L0:;
11502  __Pyx_XDECREF(__pyx_v_obj);
11503  __Pyx_XGIVEREF(__pyx_r);
11504  __Pyx_RefNannyFinishContext();
11505  return __pyx_r;
11506 }
11507 
11508 /* "View.MemoryView":436
11509  * return obj
11510  *
11511  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11512  * cdef __Pyx_memviewslice dst_slice
11513  * cdef __Pyx_memviewslice src_slice
11514  */
11515 
11516 static PyObject *__pyx_memoryview_setitem_slice_assignment(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_dst, PyObject *__pyx_v_src) {
11517  __Pyx_memviewslice __pyx_v_dst_slice;
11518  __Pyx_memviewslice __pyx_v_src_slice;
11519  PyObject *__pyx_r = NULL;
11520  __Pyx_RefNannyDeclarations
11521  PyObject *__pyx_t_1 = NULL;
11522  int __pyx_t_2;
11523  int __pyx_t_3;
11524  int __pyx_t_4;
11525  __Pyx_RefNannySetupContext("setitem_slice_assignment", 0);
11526 
11527  /* "View.MemoryView":440
11528  * cdef __Pyx_memviewslice src_slice
11529  *
11530  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11531  * get_slice_from_memview(dst, &dst_slice)[0],
11532  * src.ndim, dst.ndim, self.dtype_is_object)
11533  */
11534  if (!(likely(((__pyx_v_src) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_src, __pyx_memoryview_type))))) __PYX_ERR(0, 440, __pyx_L1_error)
11535 
11536  /* "View.MemoryView":441
11537  *
11538  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11539  * get_slice_from_memview(dst, &dst_slice)[0], # <<<<<<<<<<<<<<
11540  * src.ndim, dst.ndim, self.dtype_is_object)
11541  *
11542  */
11543  if (!(likely(((__pyx_v_dst) == Py_None) || likely(__Pyx_TypeTest(__pyx_v_dst, __pyx_memoryview_type))))) __PYX_ERR(0, 441, __pyx_L1_error)
11544 
11545  /* "View.MemoryView":442
11546  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0],
11547  * get_slice_from_memview(dst, &dst_slice)[0],
11548  * src.ndim, dst.ndim, self.dtype_is_object) # <<<<<<<<<<<<<<
11549  *
11550  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11551  */
11552  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_src, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
11553  __Pyx_GOTREF(__pyx_t_1);
11554  __pyx_t_2 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_2 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L1_error)
11555  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11556  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_dst, __pyx_n_s_ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 442, __pyx_L1_error)
11557  __Pyx_GOTREF(__pyx_t_1);
11558  __pyx_t_3 = __Pyx_PyInt_As_int(__pyx_t_1); if (unlikely((__pyx_t_3 == (int)-1) && PyErr_Occurred())) __PYX_ERR(0, 442, __pyx_L1_error)
11559  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
11560 
11561  /* "View.MemoryView":440
11562  * cdef __Pyx_memviewslice src_slice
11563  *
11564  * memoryview_copy_contents(get_slice_from_memview(src, &src_slice)[0], # <<<<<<<<<<<<<<
11565  * get_slice_from_memview(dst, &dst_slice)[0],
11566  * src.ndim, dst.ndim, self.dtype_is_object)
11567  */
11568  __pyx_t_4 = __pyx_memoryview_copy_contents((__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_src), (&__pyx_v_src_slice))[0]), (__pyx_memoryview_get_slice_from_memoryview(((struct __pyx_memoryview_obj *)__pyx_v_dst), (&__pyx_v_dst_slice))[0]), __pyx_t_2, __pyx_t_3, __pyx_v_self->dtype_is_object); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 440, __pyx_L1_error)
11569 
11570  /* "View.MemoryView":436
11571  * return obj
11572  *
11573  * cdef setitem_slice_assignment(self, dst, src): # <<<<<<<<<<<<<<
11574  * cdef __Pyx_memviewslice dst_slice
11575  * cdef __Pyx_memviewslice src_slice
11576  */
11577 
11578  /* function exit code */
11579  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11580  goto __pyx_L0;
11581  __pyx_L1_error:;
11582  __Pyx_XDECREF(__pyx_t_1);
11583  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assignment", __pyx_clineno, __pyx_lineno, __pyx_filename);
11584  __pyx_r = 0;
11585  __pyx_L0:;
11586  __Pyx_XGIVEREF(__pyx_r);
11587  __Pyx_RefNannyFinishContext();
11588  return __pyx_r;
11589 }
11590 
11591 /* "View.MemoryView":444
11592  * src.ndim, dst.ndim, self.dtype_is_object)
11593  *
11594  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11595  * cdef int array[128]
11596  * cdef void *tmp = NULL
11597  */
11598 
11599 static PyObject *__pyx_memoryview_setitem_slice_assign_scalar(struct __pyx_memoryview_obj *__pyx_v_self, struct __pyx_memoryview_obj *__pyx_v_dst, PyObject *__pyx_v_value) {
11600  int __pyx_v_array[0x80];
11601  void *__pyx_v_tmp;
11602  void *__pyx_v_item;
11603  __Pyx_memviewslice *__pyx_v_dst_slice;
11604  __Pyx_memviewslice __pyx_v_tmp_slice;
11605  PyObject *__pyx_r = NULL;
11606  __Pyx_RefNannyDeclarations
11607  int __pyx_t_1;
11608  PyObject *__pyx_t_2 = NULL;
11609  int __pyx_t_3;
11610  int __pyx_t_4;
11611  char const *__pyx_t_5;
11612  PyObject *__pyx_t_6 = NULL;
11613  PyObject *__pyx_t_7 = NULL;
11614  PyObject *__pyx_t_8 = NULL;
11615  PyObject *__pyx_t_9 = NULL;
11616  PyObject *__pyx_t_10 = NULL;
11617  PyObject *__pyx_t_11 = NULL;
11618  __Pyx_RefNannySetupContext("setitem_slice_assign_scalar", 0);
11619 
11620  /* "View.MemoryView":446
11621  * cdef setitem_slice_assign_scalar(self, memoryview dst, value):
11622  * cdef int array[128]
11623  * cdef void *tmp = NULL # <<<<<<<<<<<<<<
11624  * cdef void *item
11625  *
11626  */
11627  __pyx_v_tmp = NULL;
11628 
11629  /* "View.MemoryView":451
11630  * cdef __Pyx_memviewslice *dst_slice
11631  * cdef __Pyx_memviewslice tmp_slice
11632  * dst_slice = get_slice_from_memview(dst, &tmp_slice) # <<<<<<<<<<<<<<
11633  *
11634  * if <size_t>self.view.itemsize > sizeof(array):
11635  */
11636  __pyx_v_dst_slice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_dst, (&__pyx_v_tmp_slice));
11637 
11638  /* "View.MemoryView":453
11639  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11640  *
11641  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11642  * tmp = PyMem_Malloc(self.view.itemsize)
11643  * if tmp == NULL:
11644  */
11645  __pyx_t_1 = ((((size_t)__pyx_v_self->view.itemsize) > (sizeof(__pyx_v_array))) != 0);
11646  if (__pyx_t_1) {
11647 
11648  /* "View.MemoryView":454
11649  *
11650  * if <size_t>self.view.itemsize > sizeof(array):
11651  * tmp = PyMem_Malloc(self.view.itemsize) # <<<<<<<<<<<<<<
11652  * if tmp == NULL:
11653  * raise MemoryError
11654  */
11655  __pyx_v_tmp = PyMem_Malloc(__pyx_v_self->view.itemsize);
11656 
11657  /* "View.MemoryView":455
11658  * if <size_t>self.view.itemsize > sizeof(array):
11659  * tmp = PyMem_Malloc(self.view.itemsize)
11660  * if tmp == NULL: # <<<<<<<<<<<<<<
11661  * raise MemoryError
11662  * item = tmp
11663  */
11664  __pyx_t_1 = ((__pyx_v_tmp == NULL) != 0);
11665  if (unlikely(__pyx_t_1)) {
11666 
11667  /* "View.MemoryView":456
11668  * tmp = PyMem_Malloc(self.view.itemsize)
11669  * if tmp == NULL:
11670  * raise MemoryError # <<<<<<<<<<<<<<
11671  * item = tmp
11672  * else:
11673  */
11674  PyErr_NoMemory(); __PYX_ERR(0, 456, __pyx_L1_error)
11675 
11676  /* "View.MemoryView":455
11677  * if <size_t>self.view.itemsize > sizeof(array):
11678  * tmp = PyMem_Malloc(self.view.itemsize)
11679  * if tmp == NULL: # <<<<<<<<<<<<<<
11680  * raise MemoryError
11681  * item = tmp
11682  */
11683  }
11684 
11685  /* "View.MemoryView":457
11686  * if tmp == NULL:
11687  * raise MemoryError
11688  * item = tmp # <<<<<<<<<<<<<<
11689  * else:
11690  * item = <void *> array
11691  */
11692  __pyx_v_item = __pyx_v_tmp;
11693 
11694  /* "View.MemoryView":453
11695  * dst_slice = get_slice_from_memview(dst, &tmp_slice)
11696  *
11697  * if <size_t>self.view.itemsize > sizeof(array): # <<<<<<<<<<<<<<
11698  * tmp = PyMem_Malloc(self.view.itemsize)
11699  * if tmp == NULL:
11700  */
11701  goto __pyx_L3;
11702  }
11703 
11704  /* "View.MemoryView":459
11705  * item = tmp
11706  * else:
11707  * item = <void *> array # <<<<<<<<<<<<<<
11708  *
11709  * try:
11710  */
11711  /*else*/ {
11712  __pyx_v_item = ((void *)__pyx_v_array);
11713  }
11714  __pyx_L3:;
11715 
11716  /* "View.MemoryView":461
11717  * item = <void *> array
11718  *
11719  * try: # <<<<<<<<<<<<<<
11720  * if self.dtype_is_object:
11721  * (<PyObject **> item)[0] = <PyObject *> value
11722  */
11723  /*try:*/ {
11724 
11725  /* "View.MemoryView":462
11726  *
11727  * try:
11728  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11729  * (<PyObject **> item)[0] = <PyObject *> value
11730  * else:
11731  */
11732  __pyx_t_1 = (__pyx_v_self->dtype_is_object != 0);
11733  if (__pyx_t_1) {
11734 
11735  /* "View.MemoryView":463
11736  * try:
11737  * if self.dtype_is_object:
11738  * (<PyObject **> item)[0] = <PyObject *> value # <<<<<<<<<<<<<<
11739  * else:
11740  * self.assign_item_from_object(<char *> item, value)
11741  */
11742  (((PyObject **)__pyx_v_item)[0]) = ((PyObject *)__pyx_v_value);
11743 
11744  /* "View.MemoryView":462
11745  *
11746  * try:
11747  * if self.dtype_is_object: # <<<<<<<<<<<<<<
11748  * (<PyObject **> item)[0] = <PyObject *> value
11749  * else:
11750  */
11751  goto __pyx_L8;
11752  }
11753 
11754  /* "View.MemoryView":465
11755  * (<PyObject **> item)[0] = <PyObject *> value
11756  * else:
11757  * self.assign_item_from_object(<char *> item, value) # <<<<<<<<<<<<<<
11758  *
11759  *
11760  */
11761  /*else*/ {
11762  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, ((char *)__pyx_v_item), __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 465, __pyx_L6_error)
11763  __Pyx_GOTREF(__pyx_t_2);
11764  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11765  }
11766  __pyx_L8:;
11767 
11768  /* "View.MemoryView":469
11769  *
11770  *
11771  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11772  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11773  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11774  */
11775  __pyx_t_1 = ((__pyx_v_self->view.suboffsets != NULL) != 0);
11776  if (__pyx_t_1) {
11777 
11778  /* "View.MemoryView":470
11779  *
11780  * if self.view.suboffsets != NULL:
11781  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim) # <<<<<<<<<<<<<<
11782  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11783  * item, self.dtype_is_object)
11784  */
11785  __pyx_t_2 = assert_direct_dimensions(__pyx_v_self->view.suboffsets, __pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 470, __pyx_L6_error)
11786  __Pyx_GOTREF(__pyx_t_2);
11787  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11788 
11789  /* "View.MemoryView":469
11790  *
11791  *
11792  * if self.view.suboffsets != NULL: # <<<<<<<<<<<<<<
11793  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11794  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize,
11795  */
11796  }
11797 
11798  /* "View.MemoryView":471
11799  * if self.view.suboffsets != NULL:
11800  * assert_direct_dimensions(self.view.suboffsets, self.view.ndim)
11801  * slice_assign_scalar(dst_slice, dst.view.ndim, self.view.itemsize, # <<<<<<<<<<<<<<
11802  * item, self.dtype_is_object)
11803  * finally:
11804  */
11805  __pyx_memoryview_slice_assign_scalar(__pyx_v_dst_slice, __pyx_v_dst->view.ndim, __pyx_v_self->view.itemsize, __pyx_v_item, __pyx_v_self->dtype_is_object);
11806  }
11807 
11808  /* "View.MemoryView":474
11809  * item, self.dtype_is_object)
11810  * finally:
11811  * PyMem_Free(tmp) # <<<<<<<<<<<<<<
11812  *
11813  * cdef setitem_indexed(self, index, value):
11814  */
11815  /*finally:*/ {
11816  /*normal exit:*/{
11817  PyMem_Free(__pyx_v_tmp);
11818  goto __pyx_L7;
11819  }
11820  __pyx_L6_error:;
11821  /*exception exit:*/{
11822  __Pyx_PyThreadState_declare
11823  __Pyx_PyThreadState_assign
11824  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
11825  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
11826  if (PY_MAJOR_VERSION >= 3) __Pyx_ExceptionSwap(&__pyx_t_9, &__pyx_t_10, &__pyx_t_11);
11827  if ((PY_MAJOR_VERSION < 3) || unlikely(__Pyx_GetException(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8) < 0)) __Pyx_ErrFetch(&__pyx_t_6, &__pyx_t_7, &__pyx_t_8);
11828  __Pyx_XGOTREF(__pyx_t_6);
11829  __Pyx_XGOTREF(__pyx_t_7);
11830  __Pyx_XGOTREF(__pyx_t_8);
11831  __Pyx_XGOTREF(__pyx_t_9);
11832  __Pyx_XGOTREF(__pyx_t_10);
11833  __Pyx_XGOTREF(__pyx_t_11);
11834  __pyx_t_3 = __pyx_lineno; __pyx_t_4 = __pyx_clineno; __pyx_t_5 = __pyx_filename;
11835  {
11836  PyMem_Free(__pyx_v_tmp);
11837  }
11838  if (PY_MAJOR_VERSION >= 3) {
11839  __Pyx_XGIVEREF(__pyx_t_9);
11840  __Pyx_XGIVEREF(__pyx_t_10);
11841  __Pyx_XGIVEREF(__pyx_t_11);
11842  __Pyx_ExceptionReset(__pyx_t_9, __pyx_t_10, __pyx_t_11);
11843  }
11844  __Pyx_XGIVEREF(__pyx_t_6);
11845  __Pyx_XGIVEREF(__pyx_t_7);
11846  __Pyx_XGIVEREF(__pyx_t_8);
11847  __Pyx_ErrRestore(__pyx_t_6, __pyx_t_7, __pyx_t_8);
11848  __pyx_t_6 = 0; __pyx_t_7 = 0; __pyx_t_8 = 0; __pyx_t_9 = 0; __pyx_t_10 = 0; __pyx_t_11 = 0;
11849  __pyx_lineno = __pyx_t_3; __pyx_clineno = __pyx_t_4; __pyx_filename = __pyx_t_5;
11850  goto __pyx_L1_error;
11851  }
11852  __pyx_L7:;
11853  }
11854 
11855  /* "View.MemoryView":444
11856  * src.ndim, dst.ndim, self.dtype_is_object)
11857  *
11858  * cdef setitem_slice_assign_scalar(self, memoryview dst, value): # <<<<<<<<<<<<<<
11859  * cdef int array[128]
11860  * cdef void *tmp = NULL
11861  */
11862 
11863  /* function exit code */
11864  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11865  goto __pyx_L0;
11866  __pyx_L1_error:;
11867  __Pyx_XDECREF(__pyx_t_2);
11868  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_slice_assign_scalar", __pyx_clineno, __pyx_lineno, __pyx_filename);
11869  __pyx_r = 0;
11870  __pyx_L0:;
11871  __Pyx_XGIVEREF(__pyx_r);
11872  __Pyx_RefNannyFinishContext();
11873  return __pyx_r;
11874 }
11875 
11876 /* "View.MemoryView":476
11877  * PyMem_Free(tmp)
11878  *
11879  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11880  * cdef char *itemp = self.get_item_pointer(index)
11881  * self.assign_item_from_object(itemp, value)
11882  */
11883 
11884 static PyObject *__pyx_memoryview_setitem_indexed(struct __pyx_memoryview_obj *__pyx_v_self, PyObject *__pyx_v_index, PyObject *__pyx_v_value) {
11885  char *__pyx_v_itemp;
11886  PyObject *__pyx_r = NULL;
11887  __Pyx_RefNannyDeclarations
11888  char *__pyx_t_1;
11889  PyObject *__pyx_t_2 = NULL;
11890  __Pyx_RefNannySetupContext("setitem_indexed", 0);
11891 
11892  /* "View.MemoryView":477
11893  *
11894  * cdef setitem_indexed(self, index, value):
11895  * cdef char *itemp = self.get_item_pointer(index) # <<<<<<<<<<<<<<
11896  * self.assign_item_from_object(itemp, value)
11897  *
11898  */
11899  __pyx_t_1 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->get_item_pointer(__pyx_v_self, __pyx_v_index); if (unlikely(__pyx_t_1 == ((char *)NULL))) __PYX_ERR(0, 477, __pyx_L1_error)
11900  __pyx_v_itemp = __pyx_t_1;
11901 
11902  /* "View.MemoryView":478
11903  * cdef setitem_indexed(self, index, value):
11904  * cdef char *itemp = self.get_item_pointer(index)
11905  * self.assign_item_from_object(itemp, value) # <<<<<<<<<<<<<<
11906  *
11907  * cdef convert_item_to_object(self, char *itemp):
11908  */
11909  __pyx_t_2 = ((struct __pyx_vtabstruct_memoryview *)__pyx_v_self->__pyx_vtab)->assign_item_from_object(__pyx_v_self, __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 478, __pyx_L1_error)
11910  __Pyx_GOTREF(__pyx_t_2);
11911  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
11912 
11913  /* "View.MemoryView":476
11914  * PyMem_Free(tmp)
11915  *
11916  * cdef setitem_indexed(self, index, value): # <<<<<<<<<<<<<<
11917  * cdef char *itemp = self.get_item_pointer(index)
11918  * self.assign_item_from_object(itemp, value)
11919  */
11920 
11921  /* function exit code */
11922  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
11923  goto __pyx_L0;
11924  __pyx_L1_error:;
11925  __Pyx_XDECREF(__pyx_t_2);
11926  __Pyx_AddTraceback("View.MemoryView.memoryview.setitem_indexed", __pyx_clineno, __pyx_lineno, __pyx_filename);
11927  __pyx_r = 0;
11928  __pyx_L0:;
11929  __Pyx_XGIVEREF(__pyx_r);
11930  __Pyx_RefNannyFinishContext();
11931  return __pyx_r;
11932 }
11933 
11934 /* "View.MemoryView":480
11935  * self.assign_item_from_object(itemp, value)
11936  *
11937  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
11938  * """Only used if instantiated manually by the user, or if Cython doesn't
11939  * know how to convert the type"""
11940  */
11941 
11942 static PyObject *__pyx_memoryview_convert_item_to_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp) {
11943  PyObject *__pyx_v_struct = NULL;
11944  PyObject *__pyx_v_bytesitem = 0;
11945  PyObject *__pyx_v_result = NULL;
11946  PyObject *__pyx_r = NULL;
11947  __Pyx_RefNannyDeclarations
11948  PyObject *__pyx_t_1 = NULL;
11949  PyObject *__pyx_t_2 = NULL;
11950  PyObject *__pyx_t_3 = NULL;
11951  PyObject *__pyx_t_4 = NULL;
11952  PyObject *__pyx_t_5 = NULL;
11953  PyObject *__pyx_t_6 = NULL;
11954  PyObject *__pyx_t_7 = NULL;
11955  int __pyx_t_8;
11956  PyObject *__pyx_t_9 = NULL;
11957  size_t __pyx_t_10;
11958  int __pyx_t_11;
11959  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
11960 
11961  /* "View.MemoryView":483
11962  * """Only used if instantiated manually by the user, or if Cython doesn't
11963  * know how to convert the type"""
11964  * import struct # <<<<<<<<<<<<<<
11965  * cdef bytes bytesitem
11966  *
11967  */
11968  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 483, __pyx_L1_error)
11969  __Pyx_GOTREF(__pyx_t_1);
11970  __pyx_v_struct = __pyx_t_1;
11971  __pyx_t_1 = 0;
11972 
11973  /* "View.MemoryView":486
11974  * cdef bytes bytesitem
11975  *
11976  * bytesitem = itemp[:self.view.itemsize] # <<<<<<<<<<<<<<
11977  * try:
11978  * result = struct.unpack(self.view.format, bytesitem)
11979  */
11980  __pyx_t_1 = __Pyx_PyBytes_FromStringAndSize(__pyx_v_itemp + 0, __pyx_v_self->view.itemsize - 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 486, __pyx_L1_error)
11981  __Pyx_GOTREF(__pyx_t_1);
11982  __pyx_v_bytesitem = ((PyObject*)__pyx_t_1);
11983  __pyx_t_1 = 0;
11984 
11985  /* "View.MemoryView":487
11986  *
11987  * bytesitem = itemp[:self.view.itemsize]
11988  * try: # <<<<<<<<<<<<<<
11989  * result = struct.unpack(self.view.format, bytesitem)
11990  * except struct.error:
11991  */
11992  {
11993  __Pyx_PyThreadState_declare
11994  __Pyx_PyThreadState_assign
11995  __Pyx_ExceptionSave(&__pyx_t_2, &__pyx_t_3, &__pyx_t_4);
11996  __Pyx_XGOTREF(__pyx_t_2);
11997  __Pyx_XGOTREF(__pyx_t_3);
11998  __Pyx_XGOTREF(__pyx_t_4);
11999  /*try:*/ {
12000 
12001  /* "View.MemoryView":488
12002  * bytesitem = itemp[:self.view.itemsize]
12003  * try:
12004  * result = struct.unpack(self.view.format, bytesitem) # <<<<<<<<<<<<<<
12005  * except struct.error:
12006  * raise ValueError("Unable to convert item to object")
12007  */
12008  __pyx_t_5 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_unpack); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 488, __pyx_L3_error)
12009  __Pyx_GOTREF(__pyx_t_5);
12010  __pyx_t_6 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 488, __pyx_L3_error)
12011  __Pyx_GOTREF(__pyx_t_6);
12012  __pyx_t_7 = NULL;
12013  __pyx_t_8 = 0;
12014  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_5))) {
12015  __pyx_t_7 = PyMethod_GET_SELF(__pyx_t_5);
12016  if (likely(__pyx_t_7)) {
12017  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_5);
12018  __Pyx_INCREF(__pyx_t_7);
12019  __Pyx_INCREF(function);
12020  __Pyx_DECREF_SET(__pyx_t_5, function);
12021  __pyx_t_8 = 1;
12022  }
12023  }
12024  #if CYTHON_FAST_PYCALL
12025  if (PyFunction_Check(__pyx_t_5)) {
12026  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12027  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L3_error)
12028  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12029  __Pyx_GOTREF(__pyx_t_1);
12030  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12031  } else
12032  #endif
12033  #if CYTHON_FAST_PYCCALL
12034  if (__Pyx_PyFastCFunction_Check(__pyx_t_5)) {
12035  PyObject *__pyx_temp[3] = {__pyx_t_7, __pyx_t_6, __pyx_v_bytesitem};
12036  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_5, __pyx_temp+1-__pyx_t_8, 2+__pyx_t_8); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L3_error)
12037  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12038  __Pyx_GOTREF(__pyx_t_1);
12039  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12040  } else
12041  #endif
12042  {
12043  __pyx_t_9 = PyTuple_New(2+__pyx_t_8); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 488, __pyx_L3_error)
12044  __Pyx_GOTREF(__pyx_t_9);
12045  if (__pyx_t_7) {
12046  __Pyx_GIVEREF(__pyx_t_7); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_7); __pyx_t_7 = NULL;
12047  }
12048  __Pyx_GIVEREF(__pyx_t_6);
12049  PyTuple_SET_ITEM(__pyx_t_9, 0+__pyx_t_8, __pyx_t_6);
12050  __Pyx_INCREF(__pyx_v_bytesitem);
12051  __Pyx_GIVEREF(__pyx_v_bytesitem);
12052  PyTuple_SET_ITEM(__pyx_t_9, 1+__pyx_t_8, __pyx_v_bytesitem);
12053  __pyx_t_6 = 0;
12054  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_5, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 488, __pyx_L3_error)
12055  __Pyx_GOTREF(__pyx_t_1);
12056  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
12057  }
12058  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12059  __pyx_v_result = __pyx_t_1;
12060  __pyx_t_1 = 0;
12061 
12062  /* "View.MemoryView":487
12063  *
12064  * bytesitem = itemp[:self.view.itemsize]
12065  * try: # <<<<<<<<<<<<<<
12066  * result = struct.unpack(self.view.format, bytesitem)
12067  * except struct.error:
12068  */
12069  }
12070 
12071  /* "View.MemoryView":492
12072  * raise ValueError("Unable to convert item to object")
12073  * else:
12074  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12075  * return result[0]
12076  * return result
12077  */
12078  /*else:*/ {
12079  __pyx_t_10 = strlen(__pyx_v_self->view.format);
12080  __pyx_t_11 = ((__pyx_t_10 == 1) != 0);
12081  if (__pyx_t_11) {
12082 
12083  /* "View.MemoryView":493
12084  * else:
12085  * if len(self.view.format) == 1:
12086  * return result[0] # <<<<<<<<<<<<<<
12087  * return result
12088  *
12089  */
12090  __Pyx_XDECREF(__pyx_r);
12091  __pyx_t_1 = __Pyx_GetItemInt(__pyx_v_result, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 493, __pyx_L5_except_error)
12092  __Pyx_GOTREF(__pyx_t_1);
12093  __pyx_r = __pyx_t_1;
12094  __pyx_t_1 = 0;
12095  goto __pyx_L6_except_return;
12096 
12097  /* "View.MemoryView":492
12098  * raise ValueError("Unable to convert item to object")
12099  * else:
12100  * if len(self.view.format) == 1: # <<<<<<<<<<<<<<
12101  * return result[0]
12102  * return result
12103  */
12104  }
12105 
12106  /* "View.MemoryView":494
12107  * if len(self.view.format) == 1:
12108  * return result[0]
12109  * return result # <<<<<<<<<<<<<<
12110  *
12111  * cdef assign_item_from_object(self, char *itemp, object value):
12112  */
12113  __Pyx_XDECREF(__pyx_r);
12114  __Pyx_INCREF(__pyx_v_result);
12115  __pyx_r = __pyx_v_result;
12116  goto __pyx_L6_except_return;
12117  }
12118  __pyx_L3_error:;
12119  __Pyx_XDECREF(__pyx_t_7); __pyx_t_7 = 0;
12120  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
12121  __Pyx_XDECREF(__pyx_t_9); __pyx_t_9 = 0;
12122  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12123  __Pyx_XDECREF(__pyx_t_1); __pyx_t_1 = 0;
12124 
12125  /* "View.MemoryView":489
12126  * try:
12127  * result = struct.unpack(self.view.format, bytesitem)
12128  * except struct.error: # <<<<<<<<<<<<<<
12129  * raise ValueError("Unable to convert item to object")
12130  * else:
12131  */
12132  __Pyx_ErrFetch(&__pyx_t_1, &__pyx_t_5, &__pyx_t_9);
12133  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_error); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 489, __pyx_L5_except_error)
12134  __Pyx_GOTREF(__pyx_t_6);
12135  __pyx_t_8 = __Pyx_PyErr_GivenExceptionMatches(__pyx_t_1, __pyx_t_6);
12136  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12137  __Pyx_ErrRestore(__pyx_t_1, __pyx_t_5, __pyx_t_9);
12138  __pyx_t_1 = 0; __pyx_t_5 = 0; __pyx_t_9 = 0;
12139  if (__pyx_t_8) {
12140  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12141  if (__Pyx_GetException(&__pyx_t_9, &__pyx_t_5, &__pyx_t_1) < 0) __PYX_ERR(0, 489, __pyx_L5_except_error)
12142  __Pyx_GOTREF(__pyx_t_9);
12143  __Pyx_GOTREF(__pyx_t_5);
12144  __Pyx_GOTREF(__pyx_t_1);
12145 
12146  /* "View.MemoryView":490
12147  * result = struct.unpack(self.view.format, bytesitem)
12148  * except struct.error:
12149  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
12150  * else:
12151  * if len(self.view.format) == 1:
12152  */
12153  __pyx_t_6 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__21, NULL); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 490, __pyx_L5_except_error)
12154  __Pyx_GOTREF(__pyx_t_6);
12155  __Pyx_Raise(__pyx_t_6, 0, 0, 0);
12156  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12157  __PYX_ERR(0, 490, __pyx_L5_except_error)
12158  }
12159  goto __pyx_L5_except_error;
12160  __pyx_L5_except_error:;
12161 
12162  /* "View.MemoryView":487
12163  *
12164  * bytesitem = itemp[:self.view.itemsize]
12165  * try: # <<<<<<<<<<<<<<
12166  * result = struct.unpack(self.view.format, bytesitem)
12167  * except struct.error:
12168  */
12169  __Pyx_XGIVEREF(__pyx_t_2);
12170  __Pyx_XGIVEREF(__pyx_t_3);
12171  __Pyx_XGIVEREF(__pyx_t_4);
12172  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12173  goto __pyx_L1_error;
12174  __pyx_L6_except_return:;
12175  __Pyx_XGIVEREF(__pyx_t_2);
12176  __Pyx_XGIVEREF(__pyx_t_3);
12177  __Pyx_XGIVEREF(__pyx_t_4);
12178  __Pyx_ExceptionReset(__pyx_t_2, __pyx_t_3, __pyx_t_4);
12179  goto __pyx_L0;
12180  }
12181 
12182  /* "View.MemoryView":480
12183  * self.assign_item_from_object(itemp, value)
12184  *
12185  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
12186  * """Only used if instantiated manually by the user, or if Cython doesn't
12187  * know how to convert the type"""
12188  */
12189 
12190  /* function exit code */
12191  __pyx_L1_error:;
12192  __Pyx_XDECREF(__pyx_t_1);
12193  __Pyx_XDECREF(__pyx_t_5);
12194  __Pyx_XDECREF(__pyx_t_6);
12195  __Pyx_XDECREF(__pyx_t_7);
12196  __Pyx_XDECREF(__pyx_t_9);
12197  __Pyx_AddTraceback("View.MemoryView.memoryview.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12198  __pyx_r = 0;
12199  __pyx_L0:;
12200  __Pyx_XDECREF(__pyx_v_struct);
12201  __Pyx_XDECREF(__pyx_v_bytesitem);
12202  __Pyx_XDECREF(__pyx_v_result);
12203  __Pyx_XGIVEREF(__pyx_r);
12204  __Pyx_RefNannyFinishContext();
12205  return __pyx_r;
12206 }
12207 
12208 /* "View.MemoryView":496
12209  * return result
12210  *
12211  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12212  * """Only used if instantiated manually by the user, or if Cython doesn't
12213  * know how to convert the type"""
12214  */
12215 
12216 static PyObject *__pyx_memoryview_assign_item_from_object(struct __pyx_memoryview_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
12217  PyObject *__pyx_v_struct = NULL;
12218  char __pyx_v_c;
12219  PyObject *__pyx_v_bytesvalue = 0;
12220  Py_ssize_t __pyx_v_i;
12221  PyObject *__pyx_r = NULL;
12222  __Pyx_RefNannyDeclarations
12223  PyObject *__pyx_t_1 = NULL;
12224  int __pyx_t_2;
12225  int __pyx_t_3;
12226  PyObject *__pyx_t_4 = NULL;
12227  PyObject *__pyx_t_5 = NULL;
12228  PyObject *__pyx_t_6 = NULL;
12229  int __pyx_t_7;
12230  PyObject *__pyx_t_8 = NULL;
12231  Py_ssize_t __pyx_t_9;
12232  PyObject *__pyx_t_10 = NULL;
12233  char *__pyx_t_11;
12234  char *__pyx_t_12;
12235  char *__pyx_t_13;
12236  char *__pyx_t_14;
12237  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
12238 
12239  /* "View.MemoryView":499
12240  * """Only used if instantiated manually by the user, or if Cython doesn't
12241  * know how to convert the type"""
12242  * import struct # <<<<<<<<<<<<<<
12243  * cdef char c
12244  * cdef bytes bytesvalue
12245  */
12246  __pyx_t_1 = __Pyx_Import(__pyx_n_s_struct, 0, 0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 499, __pyx_L1_error)
12247  __Pyx_GOTREF(__pyx_t_1);
12248  __pyx_v_struct = __pyx_t_1;
12249  __pyx_t_1 = 0;
12250 
12251  /* "View.MemoryView":504
12252  * cdef Py_ssize_t i
12253  *
12254  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12255  * bytesvalue = struct.pack(self.view.format, *value)
12256  * else:
12257  */
12258  __pyx_t_2 = PyTuple_Check(__pyx_v_value);
12259  __pyx_t_3 = (__pyx_t_2 != 0);
12260  if (__pyx_t_3) {
12261 
12262  /* "View.MemoryView":505
12263  *
12264  * if isinstance(value, tuple):
12265  * bytesvalue = struct.pack(self.view.format, *value) # <<<<<<<<<<<<<<
12266  * else:
12267  * bytesvalue = struct.pack(self.view.format, value)
12268  */
12269  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 505, __pyx_L1_error)
12270  __Pyx_GOTREF(__pyx_t_1);
12271  __pyx_t_4 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
12272  __Pyx_GOTREF(__pyx_t_4);
12273  __pyx_t_5 = PyTuple_New(1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 505, __pyx_L1_error)
12274  __Pyx_GOTREF(__pyx_t_5);
12275  __Pyx_GIVEREF(__pyx_t_4);
12276  PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_4);
12277  __pyx_t_4 = 0;
12278  __pyx_t_4 = __Pyx_PySequence_Tuple(__pyx_v_value); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
12279  __Pyx_GOTREF(__pyx_t_4);
12280  __pyx_t_6 = PyNumber_Add(__pyx_t_5, __pyx_t_4); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 505, __pyx_L1_error)
12281  __Pyx_GOTREF(__pyx_t_6);
12282  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12283  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
12284  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_1, __pyx_t_6, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 505, __pyx_L1_error)
12285  __Pyx_GOTREF(__pyx_t_4);
12286  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12287  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12288  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 505, __pyx_L1_error)
12289  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12290  __pyx_t_4 = 0;
12291 
12292  /* "View.MemoryView":504
12293  * cdef Py_ssize_t i
12294  *
12295  * if isinstance(value, tuple): # <<<<<<<<<<<<<<
12296  * bytesvalue = struct.pack(self.view.format, *value)
12297  * else:
12298  */
12299  goto __pyx_L3;
12300  }
12301 
12302  /* "View.MemoryView":507
12303  * bytesvalue = struct.pack(self.view.format, *value)
12304  * else:
12305  * bytesvalue = struct.pack(self.view.format, value) # <<<<<<<<<<<<<<
12306  *
12307  * for i, c in enumerate(bytesvalue):
12308  */
12309  /*else*/ {
12310  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(__pyx_v_struct, __pyx_n_s_pack); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 507, __pyx_L1_error)
12311  __Pyx_GOTREF(__pyx_t_6);
12312  __pyx_t_1 = __Pyx_PyBytes_FromString(__pyx_v_self->view.format); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 507, __pyx_L1_error)
12313  __Pyx_GOTREF(__pyx_t_1);
12314  __pyx_t_5 = NULL;
12315  __pyx_t_7 = 0;
12316  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_6))) {
12317  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_6);
12318  if (likely(__pyx_t_5)) {
12319  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_6);
12320  __Pyx_INCREF(__pyx_t_5);
12321  __Pyx_INCREF(function);
12322  __Pyx_DECREF_SET(__pyx_t_6, function);
12323  __pyx_t_7 = 1;
12324  }
12325  }
12326  #if CYTHON_FAST_PYCALL
12327  if (PyFunction_Check(__pyx_t_6)) {
12328  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12329  __pyx_t_4 = __Pyx_PyFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
12330  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12331  __Pyx_GOTREF(__pyx_t_4);
12332  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12333  } else
12334  #endif
12335  #if CYTHON_FAST_PYCCALL
12336  if (__Pyx_PyFastCFunction_Check(__pyx_t_6)) {
12337  PyObject *__pyx_temp[3] = {__pyx_t_5, __pyx_t_1, __pyx_v_value};
12338  __pyx_t_4 = __Pyx_PyCFunction_FastCall(__pyx_t_6, __pyx_temp+1-__pyx_t_7, 2+__pyx_t_7); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
12339  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
12340  __Pyx_GOTREF(__pyx_t_4);
12341  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12342  } else
12343  #endif
12344  {
12345  __pyx_t_8 = PyTuple_New(2+__pyx_t_7); if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 507, __pyx_L1_error)
12346  __Pyx_GOTREF(__pyx_t_8);
12347  if (__pyx_t_5) {
12348  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_8, 0, __pyx_t_5); __pyx_t_5 = NULL;
12349  }
12350  __Pyx_GIVEREF(__pyx_t_1);
12351  PyTuple_SET_ITEM(__pyx_t_8, 0+__pyx_t_7, __pyx_t_1);
12352  __Pyx_INCREF(__pyx_v_value);
12353  __Pyx_GIVEREF(__pyx_v_value);
12354  PyTuple_SET_ITEM(__pyx_t_8, 1+__pyx_t_7, __pyx_v_value);
12355  __pyx_t_1 = 0;
12356  __pyx_t_4 = __Pyx_PyObject_Call(__pyx_t_6, __pyx_t_8, NULL); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 507, __pyx_L1_error)
12357  __Pyx_GOTREF(__pyx_t_4);
12358  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
12359  }
12360  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
12361  if (!(likely(PyBytes_CheckExact(__pyx_t_4))||((__pyx_t_4) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "bytes", Py_TYPE(__pyx_t_4)->tp_name), 0))) __PYX_ERR(0, 507, __pyx_L1_error)
12362  __pyx_v_bytesvalue = ((PyObject*)__pyx_t_4);
12363  __pyx_t_4 = 0;
12364  }
12365  __pyx_L3:;
12366 
12367  /* "View.MemoryView":509
12368  * bytesvalue = struct.pack(self.view.format, value)
12369  *
12370  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12371  * itemp[i] = c
12372  *
12373  */
12374  __pyx_t_9 = 0;
12375  if (unlikely(__pyx_v_bytesvalue == Py_None)) {
12376  PyErr_SetString(PyExc_TypeError, "'NoneType' is not iterable");
12377  __PYX_ERR(0, 509, __pyx_L1_error)
12378  }
12379  __Pyx_INCREF(__pyx_v_bytesvalue);
12380  __pyx_t_10 = __pyx_v_bytesvalue;
12381  __pyx_t_12 = PyBytes_AS_STRING(__pyx_t_10);
12382  __pyx_t_13 = (__pyx_t_12 + PyBytes_GET_SIZE(__pyx_t_10));
12383  for (__pyx_t_14 = __pyx_t_12; __pyx_t_14 < __pyx_t_13; __pyx_t_14++) {
12384  __pyx_t_11 = __pyx_t_14;
12385  __pyx_v_c = (__pyx_t_11[0]);
12386 
12387  /* "View.MemoryView":510
12388  *
12389  * for i, c in enumerate(bytesvalue):
12390  * itemp[i] = c # <<<<<<<<<<<<<<
12391  *
12392  * @cname('getbuffer')
12393  */
12394  __pyx_v_i = __pyx_t_9;
12395 
12396  /* "View.MemoryView":509
12397  * bytesvalue = struct.pack(self.view.format, value)
12398  *
12399  * for i, c in enumerate(bytesvalue): # <<<<<<<<<<<<<<
12400  * itemp[i] = c
12401  *
12402  */
12403  __pyx_t_9 = (__pyx_t_9 + 1);
12404 
12405  /* "View.MemoryView":510
12406  *
12407  * for i, c in enumerate(bytesvalue):
12408  * itemp[i] = c # <<<<<<<<<<<<<<
12409  *
12410  * @cname('getbuffer')
12411  */
12412  (__pyx_v_itemp[__pyx_v_i]) = __pyx_v_c;
12413  }
12414  __Pyx_DECREF(__pyx_t_10); __pyx_t_10 = 0;
12415 
12416  /* "View.MemoryView":496
12417  * return result
12418  *
12419  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
12420  * """Only used if instantiated manually by the user, or if Cython doesn't
12421  * know how to convert the type"""
12422  */
12423 
12424  /* function exit code */
12425  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
12426  goto __pyx_L0;
12427  __pyx_L1_error:;
12428  __Pyx_XDECREF(__pyx_t_1);
12429  __Pyx_XDECREF(__pyx_t_4);
12430  __Pyx_XDECREF(__pyx_t_5);
12431  __Pyx_XDECREF(__pyx_t_6);
12432  __Pyx_XDECREF(__pyx_t_8);
12433  __Pyx_XDECREF(__pyx_t_10);
12434  __Pyx_AddTraceback("View.MemoryView.memoryview.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
12435  __pyx_r = 0;
12436  __pyx_L0:;
12437  __Pyx_XDECREF(__pyx_v_struct);
12438  __Pyx_XDECREF(__pyx_v_bytesvalue);
12439  __Pyx_XGIVEREF(__pyx_r);
12440  __Pyx_RefNannyFinishContext();
12441  return __pyx_r;
12442 }
12443 
12444 /* "View.MemoryView":513
12445  *
12446  * @cname('getbuffer')
12447  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12448  * if flags & PyBUF_WRITABLE and self.view.readonly:
12449  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12450  */
12451 
12452 /* Python wrapper */
12453 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags); /*proto*/
12454 static CYTHON_UNUSED int __pyx_memoryview_getbuffer(PyObject *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12455  int __pyx_r;
12456  __Pyx_RefNannyDeclarations
12457  __Pyx_RefNannySetupContext("__getbuffer__ (wrapper)", 0);
12458  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((Py_buffer *)__pyx_v_info), ((int)__pyx_v_flags));
12459 
12460  /* function exit code */
12461  __Pyx_RefNannyFinishContext();
12462  return __pyx_r;
12463 }
12464 
12465 static int __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_8__getbuffer__(struct __pyx_memoryview_obj *__pyx_v_self, Py_buffer *__pyx_v_info, int __pyx_v_flags) {
12466  int __pyx_r;
12467  __Pyx_RefNannyDeclarations
12468  int __pyx_t_1;
12469  int __pyx_t_2;
12470  PyObject *__pyx_t_3 = NULL;
12471  Py_ssize_t *__pyx_t_4;
12472  char *__pyx_t_5;
12473  void *__pyx_t_6;
12474  int __pyx_t_7;
12475  Py_ssize_t __pyx_t_8;
12476  if (__pyx_v_info == NULL) {
12477  PyErr_SetString(PyExc_BufferError, "PyObject_GetBuffer: view==NULL argument is obsolete");
12478  return -1;
12479  }
12480  __Pyx_RefNannySetupContext("__getbuffer__", 0);
12481  __pyx_v_info->obj = Py_None; __Pyx_INCREF(Py_None);
12482  __Pyx_GIVEREF(__pyx_v_info->obj);
12483 
12484  /* "View.MemoryView":514
12485  * @cname('getbuffer')
12486  * def __getbuffer__(self, Py_buffer *info, int flags):
12487  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12488  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12489  *
12490  */
12491  __pyx_t_2 = ((__pyx_v_flags & PyBUF_WRITABLE) != 0);
12492  if (__pyx_t_2) {
12493  } else {
12494  __pyx_t_1 = __pyx_t_2;
12495  goto __pyx_L4_bool_binop_done;
12496  }
12497  __pyx_t_2 = (__pyx_v_self->view.readonly != 0);
12498  __pyx_t_1 = __pyx_t_2;
12499  __pyx_L4_bool_binop_done:;
12500  if (unlikely(__pyx_t_1)) {
12501 
12502  /* "View.MemoryView":515
12503  * def __getbuffer__(self, Py_buffer *info, int flags):
12504  * if flags & PyBUF_WRITABLE and self.view.readonly:
12505  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
12506  *
12507  * if flags & PyBUF_STRIDES:
12508  */
12509  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__22, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 515, __pyx_L1_error)
12510  __Pyx_GOTREF(__pyx_t_3);
12511  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
12512  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
12513  __PYX_ERR(0, 515, __pyx_L1_error)
12514 
12515  /* "View.MemoryView":514
12516  * @cname('getbuffer')
12517  * def __getbuffer__(self, Py_buffer *info, int flags):
12518  * if flags & PyBUF_WRITABLE and self.view.readonly: # <<<<<<<<<<<<<<
12519  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12520  *
12521  */
12522  }
12523 
12524  /* "View.MemoryView":517
12525  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12526  *
12527  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12528  * info.shape = self.view.shape
12529  * else:
12530  */
12531  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12532  if (__pyx_t_1) {
12533 
12534  /* "View.MemoryView":518
12535  *
12536  * if flags & PyBUF_STRIDES:
12537  * info.shape = self.view.shape # <<<<<<<<<<<<<<
12538  * else:
12539  * info.shape = NULL
12540  */
12541  __pyx_t_4 = __pyx_v_self->view.shape;
12542  __pyx_v_info->shape = __pyx_t_4;
12543 
12544  /* "View.MemoryView":517
12545  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12546  *
12547  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12548  * info.shape = self.view.shape
12549  * else:
12550  */
12551  goto __pyx_L6;
12552  }
12553 
12554  /* "View.MemoryView":520
12555  * info.shape = self.view.shape
12556  * else:
12557  * info.shape = NULL # <<<<<<<<<<<<<<
12558  *
12559  * if flags & PyBUF_STRIDES:
12560  */
12561  /*else*/ {
12562  __pyx_v_info->shape = NULL;
12563  }
12564  __pyx_L6:;
12565 
12566  /* "View.MemoryView":522
12567  * info.shape = NULL
12568  *
12569  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12570  * info.strides = self.view.strides
12571  * else:
12572  */
12573  __pyx_t_1 = ((__pyx_v_flags & PyBUF_STRIDES) != 0);
12574  if (__pyx_t_1) {
12575 
12576  /* "View.MemoryView":523
12577  *
12578  * if flags & PyBUF_STRIDES:
12579  * info.strides = self.view.strides # <<<<<<<<<<<<<<
12580  * else:
12581  * info.strides = NULL
12582  */
12583  __pyx_t_4 = __pyx_v_self->view.strides;
12584  __pyx_v_info->strides = __pyx_t_4;
12585 
12586  /* "View.MemoryView":522
12587  * info.shape = NULL
12588  *
12589  * if flags & PyBUF_STRIDES: # <<<<<<<<<<<<<<
12590  * info.strides = self.view.strides
12591  * else:
12592  */
12593  goto __pyx_L7;
12594  }
12595 
12596  /* "View.MemoryView":525
12597  * info.strides = self.view.strides
12598  * else:
12599  * info.strides = NULL # <<<<<<<<<<<<<<
12600  *
12601  * if flags & PyBUF_INDIRECT:
12602  */
12603  /*else*/ {
12604  __pyx_v_info->strides = NULL;
12605  }
12606  __pyx_L7:;
12607 
12608  /* "View.MemoryView":527
12609  * info.strides = NULL
12610  *
12611  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12612  * info.suboffsets = self.view.suboffsets
12613  * else:
12614  */
12615  __pyx_t_1 = ((__pyx_v_flags & PyBUF_INDIRECT) != 0);
12616  if (__pyx_t_1) {
12617 
12618  /* "View.MemoryView":528
12619  *
12620  * if flags & PyBUF_INDIRECT:
12621  * info.suboffsets = self.view.suboffsets # <<<<<<<<<<<<<<
12622  * else:
12623  * info.suboffsets = NULL
12624  */
12625  __pyx_t_4 = __pyx_v_self->view.suboffsets;
12626  __pyx_v_info->suboffsets = __pyx_t_4;
12627 
12628  /* "View.MemoryView":527
12629  * info.strides = NULL
12630  *
12631  * if flags & PyBUF_INDIRECT: # <<<<<<<<<<<<<<
12632  * info.suboffsets = self.view.suboffsets
12633  * else:
12634  */
12635  goto __pyx_L8;
12636  }
12637 
12638  /* "View.MemoryView":530
12639  * info.suboffsets = self.view.suboffsets
12640  * else:
12641  * info.suboffsets = NULL # <<<<<<<<<<<<<<
12642  *
12643  * if flags & PyBUF_FORMAT:
12644  */
12645  /*else*/ {
12646  __pyx_v_info->suboffsets = NULL;
12647  }
12648  __pyx_L8:;
12649 
12650  /* "View.MemoryView":532
12651  * info.suboffsets = NULL
12652  *
12653  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12654  * info.format = self.view.format
12655  * else:
12656  */
12657  __pyx_t_1 = ((__pyx_v_flags & PyBUF_FORMAT) != 0);
12658  if (__pyx_t_1) {
12659 
12660  /* "View.MemoryView":533
12661  *
12662  * if flags & PyBUF_FORMAT:
12663  * info.format = self.view.format # <<<<<<<<<<<<<<
12664  * else:
12665  * info.format = NULL
12666  */
12667  __pyx_t_5 = __pyx_v_self->view.format;
12668  __pyx_v_info->format = __pyx_t_5;
12669 
12670  /* "View.MemoryView":532
12671  * info.suboffsets = NULL
12672  *
12673  * if flags & PyBUF_FORMAT: # <<<<<<<<<<<<<<
12674  * info.format = self.view.format
12675  * else:
12676  */
12677  goto __pyx_L9;
12678  }
12679 
12680  /* "View.MemoryView":535
12681  * info.format = self.view.format
12682  * else:
12683  * info.format = NULL # <<<<<<<<<<<<<<
12684  *
12685  * info.buf = self.view.buf
12686  */
12687  /*else*/ {
12688  __pyx_v_info->format = NULL;
12689  }
12690  __pyx_L9:;
12691 
12692  /* "View.MemoryView":537
12693  * info.format = NULL
12694  *
12695  * info.buf = self.view.buf # <<<<<<<<<<<<<<
12696  * info.ndim = self.view.ndim
12697  * info.itemsize = self.view.itemsize
12698  */
12699  __pyx_t_6 = __pyx_v_self->view.buf;
12700  __pyx_v_info->buf = __pyx_t_6;
12701 
12702  /* "View.MemoryView":538
12703  *
12704  * info.buf = self.view.buf
12705  * info.ndim = self.view.ndim # <<<<<<<<<<<<<<
12706  * info.itemsize = self.view.itemsize
12707  * info.len = self.view.len
12708  */
12709  __pyx_t_7 = __pyx_v_self->view.ndim;
12710  __pyx_v_info->ndim = __pyx_t_7;
12711 
12712  /* "View.MemoryView":539
12713  * info.buf = self.view.buf
12714  * info.ndim = self.view.ndim
12715  * info.itemsize = self.view.itemsize # <<<<<<<<<<<<<<
12716  * info.len = self.view.len
12717  * info.readonly = self.view.readonly
12718  */
12719  __pyx_t_8 = __pyx_v_self->view.itemsize;
12720  __pyx_v_info->itemsize = __pyx_t_8;
12721 
12722  /* "View.MemoryView":540
12723  * info.ndim = self.view.ndim
12724  * info.itemsize = self.view.itemsize
12725  * info.len = self.view.len # <<<<<<<<<<<<<<
12726  * info.readonly = self.view.readonly
12727  * info.obj = self
12728  */
12729  __pyx_t_8 = __pyx_v_self->view.len;
12730  __pyx_v_info->len = __pyx_t_8;
12731 
12732  /* "View.MemoryView":541
12733  * info.itemsize = self.view.itemsize
12734  * info.len = self.view.len
12735  * info.readonly = self.view.readonly # <<<<<<<<<<<<<<
12736  * info.obj = self
12737  *
12738  */
12739  __pyx_t_1 = __pyx_v_self->view.readonly;
12740  __pyx_v_info->readonly = __pyx_t_1;
12741 
12742  /* "View.MemoryView":542
12743  * info.len = self.view.len
12744  * info.readonly = self.view.readonly
12745  * info.obj = self # <<<<<<<<<<<<<<
12746  *
12747  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
12748  */
12749  __Pyx_INCREF(((PyObject *)__pyx_v_self));
12750  __Pyx_GIVEREF(((PyObject *)__pyx_v_self));
12751  __Pyx_GOTREF(__pyx_v_info->obj);
12752  __Pyx_DECREF(__pyx_v_info->obj);
12753  __pyx_v_info->obj = ((PyObject *)__pyx_v_self);
12754 
12755  /* "View.MemoryView":513
12756  *
12757  * @cname('getbuffer')
12758  * def __getbuffer__(self, Py_buffer *info, int flags): # <<<<<<<<<<<<<<
12759  * if flags & PyBUF_WRITABLE and self.view.readonly:
12760  * raise ValueError("Cannot create writable memory view from read-only memoryview")
12761  */
12762 
12763  /* function exit code */
12764  __pyx_r = 0;
12765  goto __pyx_L0;
12766  __pyx_L1_error:;
12767  __Pyx_XDECREF(__pyx_t_3);
12768  __Pyx_AddTraceback("View.MemoryView.memoryview.__getbuffer__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12769  __pyx_r = -1;
12770  if (__pyx_v_info->obj != NULL) {
12771  __Pyx_GOTREF(__pyx_v_info->obj);
12772  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12773  }
12774  goto __pyx_L2;
12775  __pyx_L0:;
12776  if (__pyx_v_info->obj == Py_None) {
12777  __Pyx_GOTREF(__pyx_v_info->obj);
12778  __Pyx_DECREF(__pyx_v_info->obj); __pyx_v_info->obj = 0;
12779  }
12780  __pyx_L2:;
12781  __Pyx_RefNannyFinishContext();
12782  return __pyx_r;
12783 }
12784 
12785 /* "View.MemoryView":548
12786  *
12787  * @property
12788  * def T(self): # <<<<<<<<<<<<<<
12789  * cdef _memoryviewslice result = memoryview_copy(self)
12790  * transpose_memslice(&result.from_slice)
12791  */
12792 
12793 /* Python wrapper */
12794 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self); /*proto*/
12795 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(PyObject *__pyx_v_self) {
12796  PyObject *__pyx_r = 0;
12797  __Pyx_RefNannyDeclarations
12798  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12799  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12800 
12801  /* function exit code */
12802  __Pyx_RefNannyFinishContext();
12803  return __pyx_r;
12804 }
12805 
12806 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_1T___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12807  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
12808  PyObject *__pyx_r = NULL;
12809  __Pyx_RefNannyDeclarations
12810  PyObject *__pyx_t_1 = NULL;
12811  int __pyx_t_2;
12812  __Pyx_RefNannySetupContext("__get__", 0);
12813 
12814  /* "View.MemoryView":549
12815  * @property
12816  * def T(self):
12817  * cdef _memoryviewslice result = memoryview_copy(self) # <<<<<<<<<<<<<<
12818  * transpose_memslice(&result.from_slice)
12819  * return result
12820  */
12821  __pyx_t_1 = __pyx_memoryview_copy_object(__pyx_v_self); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 549, __pyx_L1_error)
12822  __Pyx_GOTREF(__pyx_t_1);
12823  if (!(likely(((__pyx_t_1) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_1, __pyx_memoryviewslice_type))))) __PYX_ERR(0, 549, __pyx_L1_error)
12824  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_1);
12825  __pyx_t_1 = 0;
12826 
12827  /* "View.MemoryView":550
12828  * def T(self):
12829  * cdef _memoryviewslice result = memoryview_copy(self)
12830  * transpose_memslice(&result.from_slice) # <<<<<<<<<<<<<<
12831  * return result
12832  *
12833  */
12834  __pyx_t_2 = __pyx_memslice_transpose((&__pyx_v_result->from_slice)); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(0, 550, __pyx_L1_error)
12835 
12836  /* "View.MemoryView":551
12837  * cdef _memoryviewslice result = memoryview_copy(self)
12838  * transpose_memslice(&result.from_slice)
12839  * return result # <<<<<<<<<<<<<<
12840  *
12841  * @property
12842  */
12843  __Pyx_XDECREF(__pyx_r);
12844  __Pyx_INCREF(((PyObject *)__pyx_v_result));
12845  __pyx_r = ((PyObject *)__pyx_v_result);
12846  goto __pyx_L0;
12847 
12848  /* "View.MemoryView":548
12849  *
12850  * @property
12851  * def T(self): # <<<<<<<<<<<<<<
12852  * cdef _memoryviewslice result = memoryview_copy(self)
12853  * transpose_memslice(&result.from_slice)
12854  */
12855 
12856  /* function exit code */
12857  __pyx_L1_error:;
12858  __Pyx_XDECREF(__pyx_t_1);
12859  __Pyx_AddTraceback("View.MemoryView.memoryview.T.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12860  __pyx_r = NULL;
12861  __pyx_L0:;
12862  __Pyx_XDECREF((PyObject *)__pyx_v_result);
12863  __Pyx_XGIVEREF(__pyx_r);
12864  __Pyx_RefNannyFinishContext();
12865  return __pyx_r;
12866 }
12867 
12868 /* "View.MemoryView":554
12869  *
12870  * @property
12871  * def base(self): # <<<<<<<<<<<<<<
12872  * return self.obj
12873  *
12874  */
12875 
12876 /* Python wrapper */
12877 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
12878 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(PyObject *__pyx_v_self) {
12879  PyObject *__pyx_r = 0;
12880  __Pyx_RefNannyDeclarations
12881  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12882  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12883 
12884  /* function exit code */
12885  __Pyx_RefNannyFinishContext();
12886  return __pyx_r;
12887 }
12888 
12889 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4base___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12890  PyObject *__pyx_r = NULL;
12891  __Pyx_RefNannyDeclarations
12892  __Pyx_RefNannySetupContext("__get__", 0);
12893 
12894  /* "View.MemoryView":555
12895  * @property
12896  * def base(self):
12897  * return self.obj # <<<<<<<<<<<<<<
12898  *
12899  * @property
12900  */
12901  __Pyx_XDECREF(__pyx_r);
12902  __Pyx_INCREF(__pyx_v_self->obj);
12903  __pyx_r = __pyx_v_self->obj;
12904  goto __pyx_L0;
12905 
12906  /* "View.MemoryView":554
12907  *
12908  * @property
12909  * def base(self): # <<<<<<<<<<<<<<
12910  * return self.obj
12911  *
12912  */
12913 
12914  /* function exit code */
12915  __pyx_L0:;
12916  __Pyx_XGIVEREF(__pyx_r);
12917  __Pyx_RefNannyFinishContext();
12918  return __pyx_r;
12919 }
12920 
12921 /* "View.MemoryView":558
12922  *
12923  * @property
12924  * def shape(self): # <<<<<<<<<<<<<<
12925  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12926  *
12927  */
12928 
12929 /* Python wrapper */
12930 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self); /*proto*/
12931 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(PyObject *__pyx_v_self) {
12932  PyObject *__pyx_r = 0;
12933  __Pyx_RefNannyDeclarations
12934  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
12935  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
12936 
12937  /* function exit code */
12938  __Pyx_RefNannyFinishContext();
12939  return __pyx_r;
12940 }
12941 
12942 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_5shape___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
12943  Py_ssize_t __pyx_v_length;
12944  PyObject *__pyx_r = NULL;
12945  __Pyx_RefNannyDeclarations
12946  PyObject *__pyx_t_1 = NULL;
12947  Py_ssize_t *__pyx_t_2;
12948  Py_ssize_t *__pyx_t_3;
12949  Py_ssize_t *__pyx_t_4;
12950  PyObject *__pyx_t_5 = NULL;
12951  __Pyx_RefNannySetupContext("__get__", 0);
12952 
12953  /* "View.MemoryView":559
12954  * @property
12955  * def shape(self):
12956  * return tuple([length for length in self.view.shape[:self.view.ndim]]) # <<<<<<<<<<<<<<
12957  *
12958  * @property
12959  */
12960  __Pyx_XDECREF(__pyx_r);
12961  __pyx_t_1 = PyList_New(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 559, __pyx_L1_error)
12962  __Pyx_GOTREF(__pyx_t_1);
12963  __pyx_t_3 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
12964  for (__pyx_t_4 = __pyx_v_self->view.shape; __pyx_t_4 < __pyx_t_3; __pyx_t_4++) {
12965  __pyx_t_2 = __pyx_t_4;
12966  __pyx_v_length = (__pyx_t_2[0]);
12967  __pyx_t_5 = PyInt_FromSsize_t(__pyx_v_length); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
12968  __Pyx_GOTREF(__pyx_t_5);
12969  if (unlikely(__Pyx_ListComp_Append(__pyx_t_1, (PyObject*)__pyx_t_5))) __PYX_ERR(0, 559, __pyx_L1_error)
12970  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
12971  }
12972  __pyx_t_5 = PyList_AsTuple(((PyObject*)__pyx_t_1)); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 559, __pyx_L1_error)
12973  __Pyx_GOTREF(__pyx_t_5);
12974  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
12975  __pyx_r = __pyx_t_5;
12976  __pyx_t_5 = 0;
12977  goto __pyx_L0;
12978 
12979  /* "View.MemoryView":558
12980  *
12981  * @property
12982  * def shape(self): # <<<<<<<<<<<<<<
12983  * return tuple([length for length in self.view.shape[:self.view.ndim]])
12984  *
12985  */
12986 
12987  /* function exit code */
12988  __pyx_L1_error:;
12989  __Pyx_XDECREF(__pyx_t_1);
12990  __Pyx_XDECREF(__pyx_t_5);
12991  __Pyx_AddTraceback("View.MemoryView.memoryview.shape.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
12992  __pyx_r = NULL;
12993  __pyx_L0:;
12994  __Pyx_XGIVEREF(__pyx_r);
12995  __Pyx_RefNannyFinishContext();
12996  return __pyx_r;
12997 }
12998 
12999 /* "View.MemoryView":562
13000  *
13001  * @property
13002  * def strides(self): # <<<<<<<<<<<<<<
13003  * if self.view.strides == NULL:
13004  *
13005  */
13006 
13007 /* Python wrapper */
13008 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self); /*proto*/
13009 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(PyObject *__pyx_v_self) {
13010  PyObject *__pyx_r = 0;
13011  __Pyx_RefNannyDeclarations
13012  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13013  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13014 
13015  /* function exit code */
13016  __Pyx_RefNannyFinishContext();
13017  return __pyx_r;
13018 }
13019 
13020 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_7strides___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13021  Py_ssize_t __pyx_v_stride;
13022  PyObject *__pyx_r = NULL;
13023  __Pyx_RefNannyDeclarations
13024  int __pyx_t_1;
13025  PyObject *__pyx_t_2 = NULL;
13026  Py_ssize_t *__pyx_t_3;
13027  Py_ssize_t *__pyx_t_4;
13028  Py_ssize_t *__pyx_t_5;
13029  PyObject *__pyx_t_6 = NULL;
13030  __Pyx_RefNannySetupContext("__get__", 0);
13031 
13032  /* "View.MemoryView":563
13033  * @property
13034  * def strides(self):
13035  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13036  *
13037  * raise ValueError("Buffer view does not expose strides")
13038  */
13039  __pyx_t_1 = ((__pyx_v_self->view.strides == NULL) != 0);
13040  if (unlikely(__pyx_t_1)) {
13041 
13042  /* "View.MemoryView":565
13043  * if self.view.strides == NULL:
13044  *
13045  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
13046  *
13047  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
13048  */
13049  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__23, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 565, __pyx_L1_error)
13050  __Pyx_GOTREF(__pyx_t_2);
13051  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
13052  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13053  __PYX_ERR(0, 565, __pyx_L1_error)
13054 
13055  /* "View.MemoryView":563
13056  * @property
13057  * def strides(self):
13058  * if self.view.strides == NULL: # <<<<<<<<<<<<<<
13059  *
13060  * raise ValueError("Buffer view does not expose strides")
13061  */
13062  }
13063 
13064  /* "View.MemoryView":567
13065  * raise ValueError("Buffer view does not expose strides")
13066  *
13067  * return tuple([stride for stride in self.view.strides[:self.view.ndim]]) # <<<<<<<<<<<<<<
13068  *
13069  * @property
13070  */
13071  __Pyx_XDECREF(__pyx_r);
13072  __pyx_t_2 = PyList_New(0); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 567, __pyx_L1_error)
13073  __Pyx_GOTREF(__pyx_t_2);
13074  __pyx_t_4 = (__pyx_v_self->view.strides + __pyx_v_self->view.ndim);
13075  for (__pyx_t_5 = __pyx_v_self->view.strides; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13076  __pyx_t_3 = __pyx_t_5;
13077  __pyx_v_stride = (__pyx_t_3[0]);
13078  __pyx_t_6 = PyInt_FromSsize_t(__pyx_v_stride); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
13079  __Pyx_GOTREF(__pyx_t_6);
13080  if (unlikely(__Pyx_ListComp_Append(__pyx_t_2, (PyObject*)__pyx_t_6))) __PYX_ERR(0, 567, __pyx_L1_error)
13081  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
13082  }
13083  __pyx_t_6 = PyList_AsTuple(((PyObject*)__pyx_t_2)); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 567, __pyx_L1_error)
13084  __Pyx_GOTREF(__pyx_t_6);
13085  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13086  __pyx_r = __pyx_t_6;
13087  __pyx_t_6 = 0;
13088  goto __pyx_L0;
13089 
13090  /* "View.MemoryView":562
13091  *
13092  * @property
13093  * def strides(self): # <<<<<<<<<<<<<<
13094  * if self.view.strides == NULL:
13095  *
13096  */
13097 
13098  /* function exit code */
13099  __pyx_L1_error:;
13100  __Pyx_XDECREF(__pyx_t_2);
13101  __Pyx_XDECREF(__pyx_t_6);
13102  __Pyx_AddTraceback("View.MemoryView.memoryview.strides.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13103  __pyx_r = NULL;
13104  __pyx_L0:;
13105  __Pyx_XGIVEREF(__pyx_r);
13106  __Pyx_RefNannyFinishContext();
13107  return __pyx_r;
13108 }
13109 
13110 /* "View.MemoryView":570
13111  *
13112  * @property
13113  * def suboffsets(self): # <<<<<<<<<<<<<<
13114  * if self.view.suboffsets == NULL:
13115  * return (-1,) * self.view.ndim
13116  */
13117 
13118 /* Python wrapper */
13119 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self); /*proto*/
13120 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(PyObject *__pyx_v_self) {
13121  PyObject *__pyx_r = 0;
13122  __Pyx_RefNannyDeclarations
13123  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13124  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13125 
13126  /* function exit code */
13127  __Pyx_RefNannyFinishContext();
13128  return __pyx_r;
13129 }
13130 
13131 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_10suboffsets___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13132  Py_ssize_t __pyx_v_suboffset;
13133  PyObject *__pyx_r = NULL;
13134  __Pyx_RefNannyDeclarations
13135  int __pyx_t_1;
13136  PyObject *__pyx_t_2 = NULL;
13137  PyObject *__pyx_t_3 = NULL;
13138  Py_ssize_t *__pyx_t_4;
13139  Py_ssize_t *__pyx_t_5;
13140  Py_ssize_t *__pyx_t_6;
13141  __Pyx_RefNannySetupContext("__get__", 0);
13142 
13143  /* "View.MemoryView":571
13144  * @property
13145  * def suboffsets(self):
13146  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13147  * return (-1,) * self.view.ndim
13148  *
13149  */
13150  __pyx_t_1 = ((__pyx_v_self->view.suboffsets == NULL) != 0);
13151  if (__pyx_t_1) {
13152 
13153  /* "View.MemoryView":572
13154  * def suboffsets(self):
13155  * if self.view.suboffsets == NULL:
13156  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
13157  *
13158  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
13159  */
13160  __Pyx_XDECREF(__pyx_r);
13161  __pyx_t_2 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 572, __pyx_L1_error)
13162  __Pyx_GOTREF(__pyx_t_2);
13163  __pyx_t_3 = PyNumber_Multiply(__pyx_tuple__24, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 572, __pyx_L1_error)
13164  __Pyx_GOTREF(__pyx_t_3);
13165  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13166  __pyx_r = __pyx_t_3;
13167  __pyx_t_3 = 0;
13168  goto __pyx_L0;
13169 
13170  /* "View.MemoryView":571
13171  * @property
13172  * def suboffsets(self):
13173  * if self.view.suboffsets == NULL: # <<<<<<<<<<<<<<
13174  * return (-1,) * self.view.ndim
13175  *
13176  */
13177  }
13178 
13179  /* "View.MemoryView":574
13180  * return (-1,) * self.view.ndim
13181  *
13182  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]]) # <<<<<<<<<<<<<<
13183  *
13184  * @property
13185  */
13186  __Pyx_XDECREF(__pyx_r);
13187  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 574, __pyx_L1_error)
13188  __Pyx_GOTREF(__pyx_t_3);
13189  __pyx_t_5 = (__pyx_v_self->view.suboffsets + __pyx_v_self->view.ndim);
13190  for (__pyx_t_6 = __pyx_v_self->view.suboffsets; __pyx_t_6 < __pyx_t_5; __pyx_t_6++) {
13191  __pyx_t_4 = __pyx_t_6;
13192  __pyx_v_suboffset = (__pyx_t_4[0]);
13193  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_suboffset); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
13194  __Pyx_GOTREF(__pyx_t_2);
13195  if (unlikely(__Pyx_ListComp_Append(__pyx_t_3, (PyObject*)__pyx_t_2))) __PYX_ERR(0, 574, __pyx_L1_error)
13196  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13197  }
13198  __pyx_t_2 = PyList_AsTuple(((PyObject*)__pyx_t_3)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 574, __pyx_L1_error)
13199  __Pyx_GOTREF(__pyx_t_2);
13200  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13201  __pyx_r = __pyx_t_2;
13202  __pyx_t_2 = 0;
13203  goto __pyx_L0;
13204 
13205  /* "View.MemoryView":570
13206  *
13207  * @property
13208  * def suboffsets(self): # <<<<<<<<<<<<<<
13209  * if self.view.suboffsets == NULL:
13210  * return (-1,) * self.view.ndim
13211  */
13212 
13213  /* function exit code */
13214  __pyx_L1_error:;
13215  __Pyx_XDECREF(__pyx_t_2);
13216  __Pyx_XDECREF(__pyx_t_3);
13217  __Pyx_AddTraceback("View.MemoryView.memoryview.suboffsets.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13218  __pyx_r = NULL;
13219  __pyx_L0:;
13220  __Pyx_XGIVEREF(__pyx_r);
13221  __Pyx_RefNannyFinishContext();
13222  return __pyx_r;
13223 }
13224 
13225 /* "View.MemoryView":577
13226  *
13227  * @property
13228  * def ndim(self): # <<<<<<<<<<<<<<
13229  * return self.view.ndim
13230  *
13231  */
13232 
13233 /* Python wrapper */
13234 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self); /*proto*/
13235 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(PyObject *__pyx_v_self) {
13236  PyObject *__pyx_r = 0;
13237  __Pyx_RefNannyDeclarations
13238  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13239  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13240 
13241  /* function exit code */
13242  __Pyx_RefNannyFinishContext();
13243  return __pyx_r;
13244 }
13245 
13246 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4ndim___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13247  PyObject *__pyx_r = NULL;
13248  __Pyx_RefNannyDeclarations
13249  PyObject *__pyx_t_1 = NULL;
13250  __Pyx_RefNannySetupContext("__get__", 0);
13251 
13252  /* "View.MemoryView":578
13253  * @property
13254  * def ndim(self):
13255  * return self.view.ndim # <<<<<<<<<<<<<<
13256  *
13257  * @property
13258  */
13259  __Pyx_XDECREF(__pyx_r);
13260  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_self->view.ndim); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 578, __pyx_L1_error)
13261  __Pyx_GOTREF(__pyx_t_1);
13262  __pyx_r = __pyx_t_1;
13263  __pyx_t_1 = 0;
13264  goto __pyx_L0;
13265 
13266  /* "View.MemoryView":577
13267  *
13268  * @property
13269  * def ndim(self): # <<<<<<<<<<<<<<
13270  * return self.view.ndim
13271  *
13272  */
13273 
13274  /* function exit code */
13275  __pyx_L1_error:;
13276  __Pyx_XDECREF(__pyx_t_1);
13277  __Pyx_AddTraceback("View.MemoryView.memoryview.ndim.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13278  __pyx_r = NULL;
13279  __pyx_L0:;
13280  __Pyx_XGIVEREF(__pyx_r);
13281  __Pyx_RefNannyFinishContext();
13282  return __pyx_r;
13283 }
13284 
13285 /* "View.MemoryView":581
13286  *
13287  * @property
13288  * def itemsize(self): # <<<<<<<<<<<<<<
13289  * return self.view.itemsize
13290  *
13291  */
13292 
13293 /* Python wrapper */
13294 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self); /*proto*/
13295 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(PyObject *__pyx_v_self) {
13296  PyObject *__pyx_r = 0;
13297  __Pyx_RefNannyDeclarations
13298  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13299  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13300 
13301  /* function exit code */
13302  __Pyx_RefNannyFinishContext();
13303  return __pyx_r;
13304 }
13305 
13306 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_8itemsize___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13307  PyObject *__pyx_r = NULL;
13308  __Pyx_RefNannyDeclarations
13309  PyObject *__pyx_t_1 = NULL;
13310  __Pyx_RefNannySetupContext("__get__", 0);
13311 
13312  /* "View.MemoryView":582
13313  * @property
13314  * def itemsize(self):
13315  * return self.view.itemsize # <<<<<<<<<<<<<<
13316  *
13317  * @property
13318  */
13319  __Pyx_XDECREF(__pyx_r);
13320  __pyx_t_1 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 582, __pyx_L1_error)
13321  __Pyx_GOTREF(__pyx_t_1);
13322  __pyx_r = __pyx_t_1;
13323  __pyx_t_1 = 0;
13324  goto __pyx_L0;
13325 
13326  /* "View.MemoryView":581
13327  *
13328  * @property
13329  * def itemsize(self): # <<<<<<<<<<<<<<
13330  * return self.view.itemsize
13331  *
13332  */
13333 
13334  /* function exit code */
13335  __pyx_L1_error:;
13336  __Pyx_XDECREF(__pyx_t_1);
13337  __Pyx_AddTraceback("View.MemoryView.memoryview.itemsize.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13338  __pyx_r = NULL;
13339  __pyx_L0:;
13340  __Pyx_XGIVEREF(__pyx_r);
13341  __Pyx_RefNannyFinishContext();
13342  return __pyx_r;
13343 }
13344 
13345 /* "View.MemoryView":585
13346  *
13347  * @property
13348  * def nbytes(self): # <<<<<<<<<<<<<<
13349  * return self.size * self.view.itemsize
13350  *
13351  */
13352 
13353 /* Python wrapper */
13354 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self); /*proto*/
13355 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(PyObject *__pyx_v_self) {
13356  PyObject *__pyx_r = 0;
13357  __Pyx_RefNannyDeclarations
13358  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13359  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13360 
13361  /* function exit code */
13362  __Pyx_RefNannyFinishContext();
13363  return __pyx_r;
13364 }
13365 
13366 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_6nbytes___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13367  PyObject *__pyx_r = NULL;
13368  __Pyx_RefNannyDeclarations
13369  PyObject *__pyx_t_1 = NULL;
13370  PyObject *__pyx_t_2 = NULL;
13371  PyObject *__pyx_t_3 = NULL;
13372  __Pyx_RefNannySetupContext("__get__", 0);
13373 
13374  /* "View.MemoryView":586
13375  * @property
13376  * def nbytes(self):
13377  * return self.size * self.view.itemsize # <<<<<<<<<<<<<<
13378  *
13379  * @property
13380  */
13381  __Pyx_XDECREF(__pyx_r);
13382  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_size); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 586, __pyx_L1_error)
13383  __Pyx_GOTREF(__pyx_t_1);
13384  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_self->view.itemsize); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 586, __pyx_L1_error)
13385  __Pyx_GOTREF(__pyx_t_2);
13386  __pyx_t_3 = PyNumber_Multiply(__pyx_t_1, __pyx_t_2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 586, __pyx_L1_error)
13387  __Pyx_GOTREF(__pyx_t_3);
13388  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13389  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13390  __pyx_r = __pyx_t_3;
13391  __pyx_t_3 = 0;
13392  goto __pyx_L0;
13393 
13394  /* "View.MemoryView":585
13395  *
13396  * @property
13397  * def nbytes(self): # <<<<<<<<<<<<<<
13398  * return self.size * self.view.itemsize
13399  *
13400  */
13401 
13402  /* function exit code */
13403  __pyx_L1_error:;
13404  __Pyx_XDECREF(__pyx_t_1);
13405  __Pyx_XDECREF(__pyx_t_2);
13406  __Pyx_XDECREF(__pyx_t_3);
13407  __Pyx_AddTraceback("View.MemoryView.memoryview.nbytes.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13408  __pyx_r = NULL;
13409  __pyx_L0:;
13410  __Pyx_XGIVEREF(__pyx_r);
13411  __Pyx_RefNannyFinishContext();
13412  return __pyx_r;
13413 }
13414 
13415 /* "View.MemoryView":589
13416  *
13417  * @property
13418  * def size(self): # <<<<<<<<<<<<<<
13419  * if self._size is None:
13420  * result = 1
13421  */
13422 
13423 /* Python wrapper */
13424 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self); /*proto*/
13425 static PyObject *__pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(PyObject *__pyx_v_self) {
13426  PyObject *__pyx_r = 0;
13427  __Pyx_RefNannyDeclarations
13428  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
13429  __pyx_r = __pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13430 
13431  /* function exit code */
13432  __Pyx_RefNannyFinishContext();
13433  return __pyx_r;
13434 }
13435 
13436 static PyObject *__pyx_pf_15View_dot_MemoryView_10memoryview_4size___get__(struct __pyx_memoryview_obj *__pyx_v_self) {
13437  PyObject *__pyx_v_result = NULL;
13438  PyObject *__pyx_v_length = NULL;
13439  PyObject *__pyx_r = NULL;
13440  __Pyx_RefNannyDeclarations
13441  int __pyx_t_1;
13442  int __pyx_t_2;
13443  Py_ssize_t *__pyx_t_3;
13444  Py_ssize_t *__pyx_t_4;
13445  Py_ssize_t *__pyx_t_5;
13446  PyObject *__pyx_t_6 = NULL;
13447  __Pyx_RefNannySetupContext("__get__", 0);
13448 
13449  /* "View.MemoryView":590
13450  * @property
13451  * def size(self):
13452  * if self._size is None: # <<<<<<<<<<<<<<
13453  * result = 1
13454  *
13455  */
13456  __pyx_t_1 = (__pyx_v_self->_size == Py_None);
13457  __pyx_t_2 = (__pyx_t_1 != 0);
13458  if (__pyx_t_2) {
13459 
13460  /* "View.MemoryView":591
13461  * def size(self):
13462  * if self._size is None:
13463  * result = 1 # <<<<<<<<<<<<<<
13464  *
13465  * for length in self.view.shape[:self.view.ndim]:
13466  */
13467  __Pyx_INCREF(__pyx_int_1);
13468  __pyx_v_result = __pyx_int_1;
13469 
13470  /* "View.MemoryView":593
13471  * result = 1
13472  *
13473  * for length in self.view.shape[:self.view.ndim]: # <<<<<<<<<<<<<<
13474  * result *= length
13475  *
13476  */
13477  __pyx_t_4 = (__pyx_v_self->view.shape + __pyx_v_self->view.ndim);
13478  for (__pyx_t_5 = __pyx_v_self->view.shape; __pyx_t_5 < __pyx_t_4; __pyx_t_5++) {
13479  __pyx_t_3 = __pyx_t_5;
13480  __pyx_t_6 = PyInt_FromSsize_t((__pyx_t_3[0])); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 593, __pyx_L1_error)
13481  __Pyx_GOTREF(__pyx_t_6);
13482  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_6);
13483  __pyx_t_6 = 0;
13484 
13485  /* "View.MemoryView":594
13486  *
13487  * for length in self.view.shape[:self.view.ndim]:
13488  * result *= length # <<<<<<<<<<<<<<
13489  *
13490  * self._size = result
13491  */
13492  __pyx_t_6 = PyNumber_InPlaceMultiply(__pyx_v_result, __pyx_v_length); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 594, __pyx_L1_error)
13493  __Pyx_GOTREF(__pyx_t_6);
13494  __Pyx_DECREF_SET(__pyx_v_result, __pyx_t_6);
13495  __pyx_t_6 = 0;
13496  }
13497 
13498  /* "View.MemoryView":596
13499  * result *= length
13500  *
13501  * self._size = result # <<<<<<<<<<<<<<
13502  *
13503  * return self._size
13504  */
13505  __Pyx_INCREF(__pyx_v_result);
13506  __Pyx_GIVEREF(__pyx_v_result);
13507  __Pyx_GOTREF(__pyx_v_self->_size);
13508  __Pyx_DECREF(__pyx_v_self->_size);
13509  __pyx_v_self->_size = __pyx_v_result;
13510 
13511  /* "View.MemoryView":590
13512  * @property
13513  * def size(self):
13514  * if self._size is None: # <<<<<<<<<<<<<<
13515  * result = 1
13516  *
13517  */
13518  }
13519 
13520  /* "View.MemoryView":598
13521  * self._size = result
13522  *
13523  * return self._size # <<<<<<<<<<<<<<
13524  *
13525  * def __len__(self):
13526  */
13527  __Pyx_XDECREF(__pyx_r);
13528  __Pyx_INCREF(__pyx_v_self->_size);
13529  __pyx_r = __pyx_v_self->_size;
13530  goto __pyx_L0;
13531 
13532  /* "View.MemoryView":589
13533  *
13534  * @property
13535  * def size(self): # <<<<<<<<<<<<<<
13536  * if self._size is None:
13537  * result = 1
13538  */
13539 
13540  /* function exit code */
13541  __pyx_L1_error:;
13542  __Pyx_XDECREF(__pyx_t_6);
13543  __Pyx_AddTraceback("View.MemoryView.memoryview.size.__get__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13544  __pyx_r = NULL;
13545  __pyx_L0:;
13546  __Pyx_XDECREF(__pyx_v_result);
13547  __Pyx_XDECREF(__pyx_v_length);
13548  __Pyx_XGIVEREF(__pyx_r);
13549  __Pyx_RefNannyFinishContext();
13550  return __pyx_r;
13551 }
13552 
13553 /* "View.MemoryView":600
13554  * return self._size
13555  *
13556  * def __len__(self): # <<<<<<<<<<<<<<
13557  * if self.view.ndim >= 1:
13558  * return self.view.shape[0]
13559  */
13560 
13561 /* Python wrapper */
13562 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self); /*proto*/
13563 static Py_ssize_t __pyx_memoryview___len__(PyObject *__pyx_v_self) {
13564  Py_ssize_t __pyx_r;
13565  __Pyx_RefNannyDeclarations
13566  __Pyx_RefNannySetupContext("__len__ (wrapper)", 0);
13567  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13568 
13569  /* function exit code */
13570  __Pyx_RefNannyFinishContext();
13571  return __pyx_r;
13572 }
13573 
13574 static Py_ssize_t __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_10__len__(struct __pyx_memoryview_obj *__pyx_v_self) {
13575  Py_ssize_t __pyx_r;
13576  __Pyx_RefNannyDeclarations
13577  int __pyx_t_1;
13578  __Pyx_RefNannySetupContext("__len__", 0);
13579 
13580  /* "View.MemoryView":601
13581  *
13582  * def __len__(self):
13583  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13584  * return self.view.shape[0]
13585  *
13586  */
13587  __pyx_t_1 = ((__pyx_v_self->view.ndim >= 1) != 0);
13588  if (__pyx_t_1) {
13589 
13590  /* "View.MemoryView":602
13591  * def __len__(self):
13592  * if self.view.ndim >= 1:
13593  * return self.view.shape[0] # <<<<<<<<<<<<<<
13594  *
13595  * return 0
13596  */
13597  __pyx_r = (__pyx_v_self->view.shape[0]);
13598  goto __pyx_L0;
13599 
13600  /* "View.MemoryView":601
13601  *
13602  * def __len__(self):
13603  * if self.view.ndim >= 1: # <<<<<<<<<<<<<<
13604  * return self.view.shape[0]
13605  *
13606  */
13607  }
13608 
13609  /* "View.MemoryView":604
13610  * return self.view.shape[0]
13611  *
13612  * return 0 # <<<<<<<<<<<<<<
13613  *
13614  * def __repr__(self):
13615  */
13616  __pyx_r = 0;
13617  goto __pyx_L0;
13618 
13619  /* "View.MemoryView":600
13620  * return self._size
13621  *
13622  * def __len__(self): # <<<<<<<<<<<<<<
13623  * if self.view.ndim >= 1:
13624  * return self.view.shape[0]
13625  */
13626 
13627  /* function exit code */
13628  __pyx_L0:;
13629  __Pyx_RefNannyFinishContext();
13630  return __pyx_r;
13631 }
13632 
13633 /* "View.MemoryView":606
13634  * return 0
13635  *
13636  * def __repr__(self): # <<<<<<<<<<<<<<
13637  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13638  * id(self))
13639  */
13640 
13641 /* Python wrapper */
13642 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self); /*proto*/
13643 static PyObject *__pyx_memoryview___repr__(PyObject *__pyx_v_self) {
13644  PyObject *__pyx_r = 0;
13645  __Pyx_RefNannyDeclarations
13646  __Pyx_RefNannySetupContext("__repr__ (wrapper)", 0);
13647  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13648 
13649  /* function exit code */
13650  __Pyx_RefNannyFinishContext();
13651  return __pyx_r;
13652 }
13653 
13654 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_12__repr__(struct __pyx_memoryview_obj *__pyx_v_self) {
13655  PyObject *__pyx_r = NULL;
13656  __Pyx_RefNannyDeclarations
13657  PyObject *__pyx_t_1 = NULL;
13658  PyObject *__pyx_t_2 = NULL;
13659  PyObject *__pyx_t_3 = NULL;
13660  __Pyx_RefNannySetupContext("__repr__", 0);
13661 
13662  /* "View.MemoryView":607
13663  *
13664  * def __repr__(self):
13665  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13666  * id(self))
13667  *
13668  */
13669  __Pyx_XDECREF(__pyx_r);
13670  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
13671  __Pyx_GOTREF(__pyx_t_1);
13672  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
13673  __Pyx_GOTREF(__pyx_t_2);
13674  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13675  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 607, __pyx_L1_error)
13676  __Pyx_GOTREF(__pyx_t_1);
13677  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13678 
13679  /* "View.MemoryView":608
13680  * def __repr__(self):
13681  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13682  * id(self)) # <<<<<<<<<<<<<<
13683  *
13684  * def __str__(self):
13685  */
13686  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_builtin_id, ((PyObject *)__pyx_v_self)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 608, __pyx_L1_error)
13687  __Pyx_GOTREF(__pyx_t_2);
13688 
13689  /* "View.MemoryView":607
13690  *
13691  * def __repr__(self):
13692  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__, # <<<<<<<<<<<<<<
13693  * id(self))
13694  *
13695  */
13696  __pyx_t_3 = PyTuple_New(2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 607, __pyx_L1_error)
13697  __Pyx_GOTREF(__pyx_t_3);
13698  __Pyx_GIVEREF(__pyx_t_1);
13699  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_t_1);
13700  __Pyx_GIVEREF(__pyx_t_2);
13701  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_2);
13702  __pyx_t_1 = 0;
13703  __pyx_t_2 = 0;
13704  __pyx_t_2 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 607, __pyx_L1_error)
13705  __Pyx_GOTREF(__pyx_t_2);
13706  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
13707  __pyx_r = __pyx_t_2;
13708  __pyx_t_2 = 0;
13709  goto __pyx_L0;
13710 
13711  /* "View.MemoryView":606
13712  * return 0
13713  *
13714  * def __repr__(self): # <<<<<<<<<<<<<<
13715  * return "<MemoryView of %r at 0x%x>" % (self.base.__class__.__name__,
13716  * id(self))
13717  */
13718 
13719  /* function exit code */
13720  __pyx_L1_error:;
13721  __Pyx_XDECREF(__pyx_t_1);
13722  __Pyx_XDECREF(__pyx_t_2);
13723  __Pyx_XDECREF(__pyx_t_3);
13724  __Pyx_AddTraceback("View.MemoryView.memoryview.__repr__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13725  __pyx_r = NULL;
13726  __pyx_L0:;
13727  __Pyx_XGIVEREF(__pyx_r);
13728  __Pyx_RefNannyFinishContext();
13729  return __pyx_r;
13730 }
13731 
13732 /* "View.MemoryView":610
13733  * id(self))
13734  *
13735  * def __str__(self): # <<<<<<<<<<<<<<
13736  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13737  *
13738  */
13739 
13740 /* Python wrapper */
13741 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self); /*proto*/
13742 static PyObject *__pyx_memoryview___str__(PyObject *__pyx_v_self) {
13743  PyObject *__pyx_r = 0;
13744  __Pyx_RefNannyDeclarations
13745  __Pyx_RefNannySetupContext("__str__ (wrapper)", 0);
13746  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(((struct __pyx_memoryview_obj *)__pyx_v_self));
13747 
13748  /* function exit code */
13749  __Pyx_RefNannyFinishContext();
13750  return __pyx_r;
13751 }
13752 
13753 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_14__str__(struct __pyx_memoryview_obj *__pyx_v_self) {
13754  PyObject *__pyx_r = NULL;
13755  __Pyx_RefNannyDeclarations
13756  PyObject *__pyx_t_1 = NULL;
13757  PyObject *__pyx_t_2 = NULL;
13758  __Pyx_RefNannySetupContext("__str__", 0);
13759 
13760  /* "View.MemoryView":611
13761  *
13762  * def __str__(self):
13763  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,) # <<<<<<<<<<<<<<
13764  *
13765  *
13766  */
13767  __Pyx_XDECREF(__pyx_r);
13768  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_self), __pyx_n_s_base); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
13769  __Pyx_GOTREF(__pyx_t_1);
13770  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(__pyx_t_1, __pyx_n_s_class); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error)
13771  __Pyx_GOTREF(__pyx_t_2);
13772  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
13773  __pyx_t_1 = __Pyx_PyObject_GetAttrStr(__pyx_t_2, __pyx_n_s_name_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
13774  __Pyx_GOTREF(__pyx_t_1);
13775  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13776  __pyx_t_2 = PyTuple_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 611, __pyx_L1_error)
13777  __Pyx_GOTREF(__pyx_t_2);
13778  __Pyx_GIVEREF(__pyx_t_1);
13779  PyTuple_SET_ITEM(__pyx_t_2, 0, __pyx_t_1);
13780  __pyx_t_1 = 0;
13781  __pyx_t_1 = __Pyx_PyString_Format(__pyx_kp_s_MemoryView_of_r_object, __pyx_t_2); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 611, __pyx_L1_error)
13782  __Pyx_GOTREF(__pyx_t_1);
13783  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
13784  __pyx_r = __pyx_t_1;
13785  __pyx_t_1 = 0;
13786  goto __pyx_L0;
13787 
13788  /* "View.MemoryView":610
13789  * id(self))
13790  *
13791  * def __str__(self): # <<<<<<<<<<<<<<
13792  * return "<MemoryView of %r object>" % (self.base.__class__.__name__,)
13793  *
13794  */
13795 
13796  /* function exit code */
13797  __pyx_L1_error:;
13798  __Pyx_XDECREF(__pyx_t_1);
13799  __Pyx_XDECREF(__pyx_t_2);
13800  __Pyx_AddTraceback("View.MemoryView.memoryview.__str__", __pyx_clineno, __pyx_lineno, __pyx_filename);
13801  __pyx_r = NULL;
13802  __pyx_L0:;
13803  __Pyx_XGIVEREF(__pyx_r);
13804  __Pyx_RefNannyFinishContext();
13805  return __pyx_r;
13806 }
13807 
13808 /* "View.MemoryView":614
13809  *
13810  *
13811  * def is_c_contig(self): # <<<<<<<<<<<<<<
13812  * cdef __Pyx_memviewslice *mslice
13813  * cdef __Pyx_memviewslice tmp
13814  */
13815 
13816 /* Python wrapper */
13817 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13818 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_17is_c_contig = {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0};
13819 static PyObject *__pyx_memoryview_is_c_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13820  PyObject *__pyx_r = 0;
13821  __Pyx_RefNannyDeclarations
13822  __Pyx_RefNannySetupContext("is_c_contig (wrapper)", 0);
13823  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13824 
13825  /* function exit code */
13826  __Pyx_RefNannyFinishContext();
13827  return __pyx_r;
13828 }
13829 
13830 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_16is_c_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13831  __Pyx_memviewslice *__pyx_v_mslice;
13832  __Pyx_memviewslice __pyx_v_tmp;
13833  PyObject *__pyx_r = NULL;
13834  __Pyx_RefNannyDeclarations
13835  PyObject *__pyx_t_1 = NULL;
13836  __Pyx_RefNannySetupContext("is_c_contig", 0);
13837 
13838  /* "View.MemoryView":617
13839  * cdef __Pyx_memviewslice *mslice
13840  * cdef __Pyx_memviewslice tmp
13841  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13842  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13843  *
13844  */
13845  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
13846 
13847  /* "View.MemoryView":618
13848  * cdef __Pyx_memviewslice tmp
13849  * mslice = get_slice_from_memview(self, &tmp)
13850  * return slice_is_contig(mslice[0], 'C', self.view.ndim) # <<<<<<<<<<<<<<
13851  *
13852  * def is_f_contig(self):
13853  */
13854  __Pyx_XDECREF(__pyx_r);
13855  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'C', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 618, __pyx_L1_error)
13856  __Pyx_GOTREF(__pyx_t_1);
13857  __pyx_r = __pyx_t_1;
13858  __pyx_t_1 = 0;
13859  goto __pyx_L0;
13860 
13861  /* "View.MemoryView":614
13862  *
13863  *
13864  * def is_c_contig(self): # <<<<<<<<<<<<<<
13865  * cdef __Pyx_memviewslice *mslice
13866  * cdef __Pyx_memviewslice tmp
13867  */
13868 
13869  /* function exit code */
13870  __pyx_L1_error:;
13871  __Pyx_XDECREF(__pyx_t_1);
13872  __Pyx_AddTraceback("View.MemoryView.memoryview.is_c_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13873  __pyx_r = NULL;
13874  __pyx_L0:;
13875  __Pyx_XGIVEREF(__pyx_r);
13876  __Pyx_RefNannyFinishContext();
13877  return __pyx_r;
13878 }
13879 
13880 /* "View.MemoryView":620
13881  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13882  *
13883  * def is_f_contig(self): # <<<<<<<<<<<<<<
13884  * cdef __Pyx_memviewslice *mslice
13885  * cdef __Pyx_memviewslice tmp
13886  */
13887 
13888 /* Python wrapper */
13889 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13890 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_19is_f_contig = {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0};
13891 static PyObject *__pyx_memoryview_is_f_contig(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13892  PyObject *__pyx_r = 0;
13893  __Pyx_RefNannyDeclarations
13894  __Pyx_RefNannySetupContext("is_f_contig (wrapper)", 0);
13895  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(((struct __pyx_memoryview_obj *)__pyx_v_self));
13896 
13897  /* function exit code */
13898  __Pyx_RefNannyFinishContext();
13899  return __pyx_r;
13900 }
13901 
13902 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_18is_f_contig(struct __pyx_memoryview_obj *__pyx_v_self) {
13903  __Pyx_memviewslice *__pyx_v_mslice;
13904  __Pyx_memviewslice __pyx_v_tmp;
13905  PyObject *__pyx_r = NULL;
13906  __Pyx_RefNannyDeclarations
13907  PyObject *__pyx_t_1 = NULL;
13908  __Pyx_RefNannySetupContext("is_f_contig", 0);
13909 
13910  /* "View.MemoryView":623
13911  * cdef __Pyx_memviewslice *mslice
13912  * cdef __Pyx_memviewslice tmp
13913  * mslice = get_slice_from_memview(self, &tmp) # <<<<<<<<<<<<<<
13914  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13915  *
13916  */
13917  __pyx_v_mslice = __pyx_memoryview_get_slice_from_memoryview(__pyx_v_self, (&__pyx_v_tmp));
13918 
13919  /* "View.MemoryView":624
13920  * cdef __Pyx_memviewslice tmp
13921  * mslice = get_slice_from_memview(self, &tmp)
13922  * return slice_is_contig(mslice[0], 'F', self.view.ndim) # <<<<<<<<<<<<<<
13923  *
13924  * def copy(self):
13925  */
13926  __Pyx_XDECREF(__pyx_r);
13927  __pyx_t_1 = __Pyx_PyBool_FromLong(__pyx_memviewslice_is_contig((__pyx_v_mslice[0]), 'F', __pyx_v_self->view.ndim)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 624, __pyx_L1_error)
13928  __Pyx_GOTREF(__pyx_t_1);
13929  __pyx_r = __pyx_t_1;
13930  __pyx_t_1 = 0;
13931  goto __pyx_L0;
13932 
13933  /* "View.MemoryView":620
13934  * return slice_is_contig(mslice[0], 'C', self.view.ndim)
13935  *
13936  * def is_f_contig(self): # <<<<<<<<<<<<<<
13937  * cdef __Pyx_memviewslice *mslice
13938  * cdef __Pyx_memviewslice tmp
13939  */
13940 
13941  /* function exit code */
13942  __pyx_L1_error:;
13943  __Pyx_XDECREF(__pyx_t_1);
13944  __Pyx_AddTraceback("View.MemoryView.memoryview.is_f_contig", __pyx_clineno, __pyx_lineno, __pyx_filename);
13945  __pyx_r = NULL;
13946  __pyx_L0:;
13947  __Pyx_XGIVEREF(__pyx_r);
13948  __Pyx_RefNannyFinishContext();
13949  return __pyx_r;
13950 }
13951 
13952 /* "View.MemoryView":626
13953  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
13954  *
13955  * def copy(self): # <<<<<<<<<<<<<<
13956  * cdef __Pyx_memviewslice mslice
13957  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13958  */
13959 
13960 /* Python wrapper */
13961 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
13962 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_21copy = {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0};
13963 static PyObject *__pyx_memoryview_copy(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
13964  PyObject *__pyx_r = 0;
13965  __Pyx_RefNannyDeclarations
13966  __Pyx_RefNannySetupContext("copy (wrapper)", 0);
13967  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(((struct __pyx_memoryview_obj *)__pyx_v_self));
13968 
13969  /* function exit code */
13970  __Pyx_RefNannyFinishContext();
13971  return __pyx_r;
13972 }
13973 
13974 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_20copy(struct __pyx_memoryview_obj *__pyx_v_self) {
13975  __Pyx_memviewslice __pyx_v_mslice;
13976  int __pyx_v_flags;
13977  PyObject *__pyx_r = NULL;
13978  __Pyx_RefNannyDeclarations
13979  __Pyx_memviewslice __pyx_t_1;
13980  PyObject *__pyx_t_2 = NULL;
13981  __Pyx_RefNannySetupContext("copy", 0);
13982 
13983  /* "View.MemoryView":628
13984  * def copy(self):
13985  * cdef __Pyx_memviewslice mslice
13986  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS # <<<<<<<<<<<<<<
13987  *
13988  * slice_copy(self, &mslice)
13989  */
13990  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_F_CONTIGUOUS));
13991 
13992  /* "View.MemoryView":630
13993  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
13994  *
13995  * slice_copy(self, &mslice) # <<<<<<<<<<<<<<
13996  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim,
13997  * self.view.itemsize,
13998  */
13999  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_mslice));
14000 
14001  /* "View.MemoryView":631
14002  *
14003  * slice_copy(self, &mslice)
14004  * mslice = slice_copy_contig(&mslice, "c", self.view.ndim, # <<<<<<<<<<<<<<
14005  * self.view.itemsize,
14006  * flags|PyBUF_C_CONTIGUOUS,
14007  */
14008  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_mslice), ((char *)"c"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_C_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 631, __pyx_L1_error)
14009  __pyx_v_mslice = __pyx_t_1;
14010 
14011  /* "View.MemoryView":636
14012  * self.dtype_is_object)
14013  *
14014  * return memoryview_copy_from_slice(self, &mslice) # <<<<<<<<<<<<<<
14015  *
14016  * def copy_fortran(self):
14017  */
14018  __Pyx_XDECREF(__pyx_r);
14019  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_mslice)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 636, __pyx_L1_error)
14020  __Pyx_GOTREF(__pyx_t_2);
14021  __pyx_r = __pyx_t_2;
14022  __pyx_t_2 = 0;
14023  goto __pyx_L0;
14024 
14025  /* "View.MemoryView":626
14026  * return slice_is_contig(mslice[0], 'F', self.view.ndim)
14027  *
14028  * def copy(self): # <<<<<<<<<<<<<<
14029  * cdef __Pyx_memviewslice mslice
14030  * cdef int flags = self.flags & ~PyBUF_F_CONTIGUOUS
14031  */
14032 
14033  /* function exit code */
14034  __pyx_L1_error:;
14035  __Pyx_XDECREF(__pyx_t_2);
14036  __Pyx_AddTraceback("View.MemoryView.memoryview.copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
14037  __pyx_r = NULL;
14038  __pyx_L0:;
14039  __Pyx_XGIVEREF(__pyx_r);
14040  __Pyx_RefNannyFinishContext();
14041  return __pyx_r;
14042 }
14043 
14044 /* "View.MemoryView":638
14045  * return memoryview_copy_from_slice(self, &mslice)
14046  *
14047  * def copy_fortran(self): # <<<<<<<<<<<<<<
14048  * cdef __Pyx_memviewslice src, dst
14049  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14050  */
14051 
14052 /* Python wrapper */
14053 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14054 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_10memoryview_23copy_fortran = {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0};
14055 static PyObject *__pyx_memoryview_copy_fortran(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14056  PyObject *__pyx_r = 0;
14057  __Pyx_RefNannyDeclarations
14058  __Pyx_RefNannySetupContext("copy_fortran (wrapper)", 0);
14059  __pyx_r = __pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(((struct __pyx_memoryview_obj *)__pyx_v_self));
14060 
14061  /* function exit code */
14062  __Pyx_RefNannyFinishContext();
14063  return __pyx_r;
14064 }
14065 
14066 static PyObject *__pyx_memoryview___pyx_pf_15View_dot_MemoryView_10memoryview_22copy_fortran(struct __pyx_memoryview_obj *__pyx_v_self) {
14067  __Pyx_memviewslice __pyx_v_src;
14068  __Pyx_memviewslice __pyx_v_dst;
14069  int __pyx_v_flags;
14070  PyObject *__pyx_r = NULL;
14071  __Pyx_RefNannyDeclarations
14072  __Pyx_memviewslice __pyx_t_1;
14073  PyObject *__pyx_t_2 = NULL;
14074  __Pyx_RefNannySetupContext("copy_fortran", 0);
14075 
14076  /* "View.MemoryView":640
14077  * def copy_fortran(self):
14078  * cdef __Pyx_memviewslice src, dst
14079  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS # <<<<<<<<<<<<<<
14080  *
14081  * slice_copy(self, &src)
14082  */
14083  __pyx_v_flags = (__pyx_v_self->flags & (~PyBUF_C_CONTIGUOUS));
14084 
14085  /* "View.MemoryView":642
14086  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14087  *
14088  * slice_copy(self, &src) # <<<<<<<<<<<<<<
14089  * dst = slice_copy_contig(&src, "fortran", self.view.ndim,
14090  * self.view.itemsize,
14091  */
14092  __pyx_memoryview_slice_copy(__pyx_v_self, (&__pyx_v_src));
14093 
14094  /* "View.MemoryView":643
14095  *
14096  * slice_copy(self, &src)
14097  * dst = slice_copy_contig(&src, "fortran", self.view.ndim, # <<<<<<<<<<<<<<
14098  * self.view.itemsize,
14099  * flags|PyBUF_F_CONTIGUOUS,
14100  */
14101  __pyx_t_1 = __pyx_memoryview_copy_new_contig((&__pyx_v_src), ((char *)"fortran"), __pyx_v_self->view.ndim, __pyx_v_self->view.itemsize, (__pyx_v_flags | PyBUF_F_CONTIGUOUS), __pyx_v_self->dtype_is_object); if (unlikely(PyErr_Occurred())) __PYX_ERR(0, 643, __pyx_L1_error)
14102  __pyx_v_dst = __pyx_t_1;
14103 
14104  /* "View.MemoryView":648
14105  * self.dtype_is_object)
14106  *
14107  * return memoryview_copy_from_slice(self, &dst) # <<<<<<<<<<<<<<
14108  *
14109  *
14110  */
14111  __Pyx_XDECREF(__pyx_r);
14112  __pyx_t_2 = __pyx_memoryview_copy_object_from_slice(__pyx_v_self, (&__pyx_v_dst)); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 648, __pyx_L1_error)
14113  __Pyx_GOTREF(__pyx_t_2);
14114  __pyx_r = __pyx_t_2;
14115  __pyx_t_2 = 0;
14116  goto __pyx_L0;
14117 
14118  /* "View.MemoryView":638
14119  * return memoryview_copy_from_slice(self, &mslice)
14120  *
14121  * def copy_fortran(self): # <<<<<<<<<<<<<<
14122  * cdef __Pyx_memviewslice src, dst
14123  * cdef int flags = self.flags & ~PyBUF_C_CONTIGUOUS
14124  */
14125 
14126  /* function exit code */
14127  __pyx_L1_error:;
14128  __Pyx_XDECREF(__pyx_t_2);
14129  __Pyx_AddTraceback("View.MemoryView.memoryview.copy_fortran", __pyx_clineno, __pyx_lineno, __pyx_filename);
14130  __pyx_r = NULL;
14131  __pyx_L0:;
14132  __Pyx_XGIVEREF(__pyx_r);
14133  __Pyx_RefNannyFinishContext();
14134  return __pyx_r;
14135 }
14136 
14137 /* "(tree fragment)":1
14138  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14139  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14140  * def __setstate_cython__(self, __pyx_state):
14141  */
14142 
14143 /* Python wrapper */
14144 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
14145 static PyMethodDef __pyx_mdef___pyx_memoryview_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0};
14146 static PyObject *__pyx_pw___pyx_memoryview_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
14147  PyObject *__pyx_r = 0;
14148  __Pyx_RefNannyDeclarations
14149  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
14150  __pyx_r = __pyx_pf___pyx_memoryview___reduce_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self));
14151 
14152  /* function exit code */
14153  __Pyx_RefNannyFinishContext();
14154  return __pyx_r;
14155 }
14156 
14157 static PyObject *__pyx_pf___pyx_memoryview___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self) {
14158  PyObject *__pyx_r = NULL;
14159  __Pyx_RefNannyDeclarations
14160  PyObject *__pyx_t_1 = NULL;
14161  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
14162 
14163  /* "(tree fragment)":2
14164  * def __reduce_cython__(self):
14165  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14166  * def __setstate_cython__(self, __pyx_state):
14167  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14168  */
14169  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__25, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
14170  __Pyx_GOTREF(__pyx_t_1);
14171  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14172  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14173  __PYX_ERR(0, 2, __pyx_L1_error)
14174 
14175  /* "(tree fragment)":1
14176  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
14177  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14178  * def __setstate_cython__(self, __pyx_state):
14179  */
14180 
14181  /* function exit code */
14182  __pyx_L1_error:;
14183  __Pyx_XDECREF(__pyx_t_1);
14184  __Pyx_AddTraceback("View.MemoryView.memoryview.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14185  __pyx_r = NULL;
14186  __Pyx_XGIVEREF(__pyx_r);
14187  __Pyx_RefNannyFinishContext();
14188  return __pyx_r;
14189 }
14190 
14191 /* "(tree fragment)":3
14192  * def __reduce_cython__(self):
14193  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14194  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14195  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14196  */
14197 
14198 /* Python wrapper */
14199 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
14200 static PyMethodDef __pyx_mdef___pyx_memoryview_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0};
14201 static PyObject *__pyx_pw___pyx_memoryview_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
14202  PyObject *__pyx_r = 0;
14203  __Pyx_RefNannyDeclarations
14204  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
14205  __pyx_r = __pyx_pf___pyx_memoryview_2__setstate_cython__(((struct __pyx_memoryview_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
14206 
14207  /* function exit code */
14208  __Pyx_RefNannyFinishContext();
14209  return __pyx_r;
14210 }
14211 
14212 static PyObject *__pyx_pf___pyx_memoryview_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryview_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
14213  PyObject *__pyx_r = NULL;
14214  __Pyx_RefNannyDeclarations
14215  PyObject *__pyx_t_1 = NULL;
14216  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
14217 
14218  /* "(tree fragment)":4
14219  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14220  * def __setstate_cython__(self, __pyx_state):
14221  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
14222  */
14223  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__26, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
14224  __Pyx_GOTREF(__pyx_t_1);
14225  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
14226  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
14227  __PYX_ERR(0, 4, __pyx_L1_error)
14228 
14229  /* "(tree fragment)":3
14230  * def __reduce_cython__(self):
14231  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14232  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
14233  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
14234  */
14235 
14236  /* function exit code */
14237  __pyx_L1_error:;
14238  __Pyx_XDECREF(__pyx_t_1);
14239  __Pyx_AddTraceback("View.MemoryView.memoryview.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
14240  __pyx_r = NULL;
14241  __Pyx_XGIVEREF(__pyx_r);
14242  __Pyx_RefNannyFinishContext();
14243  return __pyx_r;
14244 }
14245 
14246 /* "View.MemoryView":652
14247  *
14248  * @cname('__pyx_memoryview_new')
14249  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14250  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14251  * result.typeinfo = typeinfo
14252  */
14253 
14254 static PyObject *__pyx_memoryview_new(PyObject *__pyx_v_o, int __pyx_v_flags, int __pyx_v_dtype_is_object, __Pyx_TypeInfo *__pyx_v_typeinfo) {
14255  struct __pyx_memoryview_obj *__pyx_v_result = 0;
14256  PyObject *__pyx_r = NULL;
14257  __Pyx_RefNannyDeclarations
14258  PyObject *__pyx_t_1 = NULL;
14259  PyObject *__pyx_t_2 = NULL;
14260  PyObject *__pyx_t_3 = NULL;
14261  __Pyx_RefNannySetupContext("memoryview_cwrapper", 0);
14262 
14263  /* "View.MemoryView":653
14264  * @cname('__pyx_memoryview_new')
14265  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14266  * cdef memoryview result = memoryview(o, flags, dtype_is_object) # <<<<<<<<<<<<<<
14267  * result.typeinfo = typeinfo
14268  * return result
14269  */
14270  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_flags); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 653, __pyx_L1_error)
14271  __Pyx_GOTREF(__pyx_t_1);
14272  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
14273  __Pyx_GOTREF(__pyx_t_2);
14274  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 653, __pyx_L1_error)
14275  __Pyx_GOTREF(__pyx_t_3);
14276  __Pyx_INCREF(__pyx_v_o);
14277  __Pyx_GIVEREF(__pyx_v_o);
14278  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_o);
14279  __Pyx_GIVEREF(__pyx_t_1);
14280  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_t_1);
14281  __Pyx_GIVEREF(__pyx_t_2);
14282  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
14283  __pyx_t_1 = 0;
14284  __pyx_t_2 = 0;
14285  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryview_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 653, __pyx_L1_error)
14286  __Pyx_GOTREF(__pyx_t_2);
14287  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14288  __pyx_v_result = ((struct __pyx_memoryview_obj *)__pyx_t_2);
14289  __pyx_t_2 = 0;
14290 
14291  /* "View.MemoryView":654
14292  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo):
14293  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14294  * result.typeinfo = typeinfo # <<<<<<<<<<<<<<
14295  * return result
14296  *
14297  */
14298  __pyx_v_result->typeinfo = __pyx_v_typeinfo;
14299 
14300  /* "View.MemoryView":655
14301  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14302  * result.typeinfo = typeinfo
14303  * return result # <<<<<<<<<<<<<<
14304  *
14305  * @cname('__pyx_memoryview_check')
14306  */
14307  __Pyx_XDECREF(__pyx_r);
14308  __Pyx_INCREF(((PyObject *)__pyx_v_result));
14309  __pyx_r = ((PyObject *)__pyx_v_result);
14310  goto __pyx_L0;
14311 
14312  /* "View.MemoryView":652
14313  *
14314  * @cname('__pyx_memoryview_new')
14315  * cdef memoryview_cwrapper(object o, int flags, bint dtype_is_object, __Pyx_TypeInfo *typeinfo): # <<<<<<<<<<<<<<
14316  * cdef memoryview result = memoryview(o, flags, dtype_is_object)
14317  * result.typeinfo = typeinfo
14318  */
14319 
14320  /* function exit code */
14321  __pyx_L1_error:;
14322  __Pyx_XDECREF(__pyx_t_1);
14323  __Pyx_XDECREF(__pyx_t_2);
14324  __Pyx_XDECREF(__pyx_t_3);
14325  __Pyx_AddTraceback("View.MemoryView.memoryview_cwrapper", __pyx_clineno, __pyx_lineno, __pyx_filename);
14326  __pyx_r = 0;
14327  __pyx_L0:;
14328  __Pyx_XDECREF((PyObject *)__pyx_v_result);
14329  __Pyx_XGIVEREF(__pyx_r);
14330  __Pyx_RefNannyFinishContext();
14331  return __pyx_r;
14332 }
14333 
14334 /* "View.MemoryView":658
14335  *
14336  * @cname('__pyx_memoryview_check')
14337  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14338  * return isinstance(o, memoryview)
14339  *
14340  */
14341 
14342 static CYTHON_INLINE int __pyx_memoryview_check(PyObject *__pyx_v_o) {
14343  int __pyx_r;
14344  __Pyx_RefNannyDeclarations
14345  int __pyx_t_1;
14346  __Pyx_RefNannySetupContext("memoryview_check", 0);
14347 
14348  /* "View.MemoryView":659
14349  * @cname('__pyx_memoryview_check')
14350  * cdef inline bint memoryview_check(object o):
14351  * return isinstance(o, memoryview) # <<<<<<<<<<<<<<
14352  *
14353  * cdef tuple _unellipsify(object index, int ndim):
14354  */
14355  __pyx_t_1 = __Pyx_TypeCheck(__pyx_v_o, __pyx_memoryview_type);
14356  __pyx_r = __pyx_t_1;
14357  goto __pyx_L0;
14358 
14359  /* "View.MemoryView":658
14360  *
14361  * @cname('__pyx_memoryview_check')
14362  * cdef inline bint memoryview_check(object o): # <<<<<<<<<<<<<<
14363  * return isinstance(o, memoryview)
14364  *
14365  */
14366 
14367  /* function exit code */
14368  __pyx_L0:;
14369  __Pyx_RefNannyFinishContext();
14370  return __pyx_r;
14371 }
14372 
14373 /* "View.MemoryView":661
14374  * return isinstance(o, memoryview)
14375  *
14376  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14377  * """
14378  * Replace all ellipses with full slices and fill incomplete indices with
14379  */
14380 
14381 static PyObject *_unellipsify(PyObject *__pyx_v_index, int __pyx_v_ndim) {
14382  PyObject *__pyx_v_tup = NULL;
14383  PyObject *__pyx_v_result = NULL;
14384  int __pyx_v_have_slices;
14385  int __pyx_v_seen_ellipsis;
14386  CYTHON_UNUSED PyObject *__pyx_v_idx = NULL;
14387  PyObject *__pyx_v_item = NULL;
14388  Py_ssize_t __pyx_v_nslices;
14389  PyObject *__pyx_r = NULL;
14390  __Pyx_RefNannyDeclarations
14391  int __pyx_t_1;
14392  int __pyx_t_2;
14393  PyObject *__pyx_t_3 = NULL;
14394  PyObject *__pyx_t_4 = NULL;
14395  Py_ssize_t __pyx_t_5;
14396  PyObject *(*__pyx_t_6)(PyObject *);
14397  PyObject *__pyx_t_7 = NULL;
14398  Py_ssize_t __pyx_t_8;
14399  int __pyx_t_9;
14400  int __pyx_t_10;
14401  PyObject *__pyx_t_11 = NULL;
14402  __Pyx_RefNannySetupContext("_unellipsify", 0);
14403 
14404  /* "View.MemoryView":666
14405  * full slices.
14406  * """
14407  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14408  * tup = (index,)
14409  * else:
14410  */
14411  __pyx_t_1 = PyTuple_Check(__pyx_v_index);
14412  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
14413  if (__pyx_t_2) {
14414 
14415  /* "View.MemoryView":667
14416  * """
14417  * if not isinstance(index, tuple):
14418  * tup = (index,) # <<<<<<<<<<<<<<
14419  * else:
14420  * tup = index
14421  */
14422  __pyx_t_3 = PyTuple_New(1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 667, __pyx_L1_error)
14423  __Pyx_GOTREF(__pyx_t_3);
14424  __Pyx_INCREF(__pyx_v_index);
14425  __Pyx_GIVEREF(__pyx_v_index);
14426  PyTuple_SET_ITEM(__pyx_t_3, 0, __pyx_v_index);
14427  __pyx_v_tup = __pyx_t_3;
14428  __pyx_t_3 = 0;
14429 
14430  /* "View.MemoryView":666
14431  * full slices.
14432  * """
14433  * if not isinstance(index, tuple): # <<<<<<<<<<<<<<
14434  * tup = (index,)
14435  * else:
14436  */
14437  goto __pyx_L3;
14438  }
14439 
14440  /* "View.MemoryView":669
14441  * tup = (index,)
14442  * else:
14443  * tup = index # <<<<<<<<<<<<<<
14444  *
14445  * result = []
14446  */
14447  /*else*/ {
14448  __Pyx_INCREF(__pyx_v_index);
14449  __pyx_v_tup = __pyx_v_index;
14450  }
14451  __pyx_L3:;
14452 
14453  /* "View.MemoryView":671
14454  * tup = index
14455  *
14456  * result = [] # <<<<<<<<<<<<<<
14457  * have_slices = False
14458  * seen_ellipsis = False
14459  */
14460  __pyx_t_3 = PyList_New(0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 671, __pyx_L1_error)
14461  __Pyx_GOTREF(__pyx_t_3);
14462  __pyx_v_result = ((PyObject*)__pyx_t_3);
14463  __pyx_t_3 = 0;
14464 
14465  /* "View.MemoryView":672
14466  *
14467  * result = []
14468  * have_slices = False # <<<<<<<<<<<<<<
14469  * seen_ellipsis = False
14470  * for idx, item in enumerate(tup):
14471  */
14472  __pyx_v_have_slices = 0;
14473 
14474  /* "View.MemoryView":673
14475  * result = []
14476  * have_slices = False
14477  * seen_ellipsis = False # <<<<<<<<<<<<<<
14478  * for idx, item in enumerate(tup):
14479  * if item is Ellipsis:
14480  */
14481  __pyx_v_seen_ellipsis = 0;
14482 
14483  /* "View.MemoryView":674
14484  * have_slices = False
14485  * seen_ellipsis = False
14486  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14487  * if item is Ellipsis:
14488  * if not seen_ellipsis:
14489  */
14490  __Pyx_INCREF(__pyx_int_0);
14491  __pyx_t_3 = __pyx_int_0;
14492  if (likely(PyList_CheckExact(__pyx_v_tup)) || PyTuple_CheckExact(__pyx_v_tup)) {
14493  __pyx_t_4 = __pyx_v_tup; __Pyx_INCREF(__pyx_t_4); __pyx_t_5 = 0;
14494  __pyx_t_6 = NULL;
14495  } else {
14496  __pyx_t_5 = -1; __pyx_t_4 = PyObject_GetIter(__pyx_v_tup); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 674, __pyx_L1_error)
14497  __Pyx_GOTREF(__pyx_t_4);
14498  __pyx_t_6 = Py_TYPE(__pyx_t_4)->tp_iternext; if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 674, __pyx_L1_error)
14499  }
14500  for (;;) {
14501  if (likely(!__pyx_t_6)) {
14502  if (likely(PyList_CheckExact(__pyx_t_4))) {
14503  if (__pyx_t_5 >= PyList_GET_SIZE(__pyx_t_4)) break;
14504  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14505  __pyx_t_7 = PyList_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 674, __pyx_L1_error)
14506  #else
14507  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L1_error)
14508  __Pyx_GOTREF(__pyx_t_7);
14509  #endif
14510  } else {
14511  if (__pyx_t_5 >= PyTuple_GET_SIZE(__pyx_t_4)) break;
14512  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
14513  __pyx_t_7 = PyTuple_GET_ITEM(__pyx_t_4, __pyx_t_5); __Pyx_INCREF(__pyx_t_7); __pyx_t_5++; if (unlikely(0 < 0)) __PYX_ERR(0, 674, __pyx_L1_error)
14514  #else
14515  __pyx_t_7 = PySequence_ITEM(__pyx_t_4, __pyx_t_5); __pyx_t_5++; if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L1_error)
14516  __Pyx_GOTREF(__pyx_t_7);
14517  #endif
14518  }
14519  } else {
14520  __pyx_t_7 = __pyx_t_6(__pyx_t_4);
14521  if (unlikely(!__pyx_t_7)) {
14522  PyObject* exc_type = PyErr_Occurred();
14523  if (exc_type) {
14524  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
14525  else __PYX_ERR(0, 674, __pyx_L1_error)
14526  }
14527  break;
14528  }
14529  __Pyx_GOTREF(__pyx_t_7);
14530  }
14531  __Pyx_XDECREF_SET(__pyx_v_item, __pyx_t_7);
14532  __pyx_t_7 = 0;
14533  __Pyx_INCREF(__pyx_t_3);
14534  __Pyx_XDECREF_SET(__pyx_v_idx, __pyx_t_3);
14535  __pyx_t_7 = __Pyx_PyInt_AddObjC(__pyx_t_3, __pyx_int_1, 1, 0); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 674, __pyx_L1_error)
14536  __Pyx_GOTREF(__pyx_t_7);
14537  __Pyx_DECREF(__pyx_t_3);
14538  __pyx_t_3 = __pyx_t_7;
14539  __pyx_t_7 = 0;
14540 
14541  /* "View.MemoryView":675
14542  * seen_ellipsis = False
14543  * for idx, item in enumerate(tup):
14544  * if item is Ellipsis: # <<<<<<<<<<<<<<
14545  * if not seen_ellipsis:
14546  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14547  */
14548  __pyx_t_2 = (__pyx_v_item == __pyx_builtin_Ellipsis);
14549  __pyx_t_1 = (__pyx_t_2 != 0);
14550  if (__pyx_t_1) {
14551 
14552  /* "View.MemoryView":676
14553  * for idx, item in enumerate(tup):
14554  * if item is Ellipsis:
14555  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14556  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14557  * seen_ellipsis = True
14558  */
14559  __pyx_t_1 = ((!(__pyx_v_seen_ellipsis != 0)) != 0);
14560  if (__pyx_t_1) {
14561 
14562  /* "View.MemoryView":677
14563  * if item is Ellipsis:
14564  * if not seen_ellipsis:
14565  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
14566  * seen_ellipsis = True
14567  * else:
14568  */
14569  __pyx_t_8 = PyObject_Length(__pyx_v_tup); if (unlikely(__pyx_t_8 == ((Py_ssize_t)-1))) __PYX_ERR(0, 677, __pyx_L1_error)
14570  __pyx_t_7 = PyList_New(1 * ((((__pyx_v_ndim - __pyx_t_8) + 1)<0) ? 0:((__pyx_v_ndim - __pyx_t_8) + 1))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 677, __pyx_L1_error)
14571  __Pyx_GOTREF(__pyx_t_7);
14572  { Py_ssize_t __pyx_temp;
14573  for (__pyx_temp=0; __pyx_temp < ((__pyx_v_ndim - __pyx_t_8) + 1); __pyx_temp++) {
14574  __Pyx_INCREF(__pyx_slice__27);
14575  __Pyx_GIVEREF(__pyx_slice__27);
14576  PyList_SET_ITEM(__pyx_t_7, __pyx_temp, __pyx_slice__27);
14577  }
14578  }
14579  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_7); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 677, __pyx_L1_error)
14580  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14581 
14582  /* "View.MemoryView":678
14583  * if not seen_ellipsis:
14584  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14585  * seen_ellipsis = True # <<<<<<<<<<<<<<
14586  * else:
14587  * result.append(slice(None))
14588  */
14589  __pyx_v_seen_ellipsis = 1;
14590 
14591  /* "View.MemoryView":676
14592  * for idx, item in enumerate(tup):
14593  * if item is Ellipsis:
14594  * if not seen_ellipsis: # <<<<<<<<<<<<<<
14595  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14596  * seen_ellipsis = True
14597  */
14598  goto __pyx_L7;
14599  }
14600 
14601  /* "View.MemoryView":680
14602  * seen_ellipsis = True
14603  * else:
14604  * result.append(slice(None)) # <<<<<<<<<<<<<<
14605  * have_slices = True
14606  * else:
14607  */
14608  /*else*/ {
14609  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_slice__28); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 680, __pyx_L1_error)
14610  }
14611  __pyx_L7:;
14612 
14613  /* "View.MemoryView":681
14614  * else:
14615  * result.append(slice(None))
14616  * have_slices = True # <<<<<<<<<<<<<<
14617  * else:
14618  * if not isinstance(item, slice) and not PyIndex_Check(item):
14619  */
14620  __pyx_v_have_slices = 1;
14621 
14622  /* "View.MemoryView":675
14623  * seen_ellipsis = False
14624  * for idx, item in enumerate(tup):
14625  * if item is Ellipsis: # <<<<<<<<<<<<<<
14626  * if not seen_ellipsis:
14627  * result.extend([slice(None)] * (ndim - len(tup) + 1))
14628  */
14629  goto __pyx_L6;
14630  }
14631 
14632  /* "View.MemoryView":683
14633  * have_slices = True
14634  * else:
14635  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14636  * raise TypeError("Cannot index with type '%s'" % type(item))
14637  *
14638  */
14639  /*else*/ {
14640  __pyx_t_2 = PySlice_Check(__pyx_v_item);
14641  __pyx_t_10 = ((!(__pyx_t_2 != 0)) != 0);
14642  if (__pyx_t_10) {
14643  } else {
14644  __pyx_t_1 = __pyx_t_10;
14645  goto __pyx_L9_bool_binop_done;
14646  }
14647  __pyx_t_10 = ((!(PyIndex_Check(__pyx_v_item) != 0)) != 0);
14648  __pyx_t_1 = __pyx_t_10;
14649  __pyx_L9_bool_binop_done:;
14650  if (unlikely(__pyx_t_1)) {
14651 
14652  /* "View.MemoryView":684
14653  * else:
14654  * if not isinstance(item, slice) and not PyIndex_Check(item):
14655  * raise TypeError("Cannot index with type '%s'" % type(item)) # <<<<<<<<<<<<<<
14656  *
14657  * have_slices = have_slices or isinstance(item, slice)
14658  */
14659  __pyx_t_7 = __Pyx_PyString_Format(__pyx_kp_s_Cannot_index_with_type_s, ((PyObject *)Py_TYPE(__pyx_v_item))); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 684, __pyx_L1_error)
14660  __Pyx_GOTREF(__pyx_t_7);
14661  __pyx_t_11 = __Pyx_PyObject_CallOneArg(__pyx_builtin_TypeError, __pyx_t_7); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 684, __pyx_L1_error)
14662  __Pyx_GOTREF(__pyx_t_11);
14663  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
14664  __Pyx_Raise(__pyx_t_11, 0, 0, 0);
14665  __Pyx_DECREF(__pyx_t_11); __pyx_t_11 = 0;
14666  __PYX_ERR(0, 684, __pyx_L1_error)
14667 
14668  /* "View.MemoryView":683
14669  * have_slices = True
14670  * else:
14671  * if not isinstance(item, slice) and not PyIndex_Check(item): # <<<<<<<<<<<<<<
14672  * raise TypeError("Cannot index with type '%s'" % type(item))
14673  *
14674  */
14675  }
14676 
14677  /* "View.MemoryView":686
14678  * raise TypeError("Cannot index with type '%s'" % type(item))
14679  *
14680  * have_slices = have_slices or isinstance(item, slice) # <<<<<<<<<<<<<<
14681  * result.append(item)
14682  *
14683  */
14684  __pyx_t_10 = (__pyx_v_have_slices != 0);
14685  if (!__pyx_t_10) {
14686  } else {
14687  __pyx_t_1 = __pyx_t_10;
14688  goto __pyx_L11_bool_binop_done;
14689  }
14690  __pyx_t_10 = PySlice_Check(__pyx_v_item);
14691  __pyx_t_2 = (__pyx_t_10 != 0);
14692  __pyx_t_1 = __pyx_t_2;
14693  __pyx_L11_bool_binop_done:;
14694  __pyx_v_have_slices = __pyx_t_1;
14695 
14696  /* "View.MemoryView":687
14697  *
14698  * have_slices = have_slices or isinstance(item, slice)
14699  * result.append(item) # <<<<<<<<<<<<<<
14700  *
14701  * nslices = ndim - len(result)
14702  */
14703  __pyx_t_9 = __Pyx_PyList_Append(__pyx_v_result, __pyx_v_item); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 687, __pyx_L1_error)
14704  }
14705  __pyx_L6:;
14706 
14707  /* "View.MemoryView":674
14708  * have_slices = False
14709  * seen_ellipsis = False
14710  * for idx, item in enumerate(tup): # <<<<<<<<<<<<<<
14711  * if item is Ellipsis:
14712  * if not seen_ellipsis:
14713  */
14714  }
14715  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
14716  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14717 
14718  /* "View.MemoryView":689
14719  * result.append(item)
14720  *
14721  * nslices = ndim - len(result) # <<<<<<<<<<<<<<
14722  * if nslices:
14723  * result.extend([slice(None)] * nslices)
14724  */
14725  __pyx_t_5 = PyList_GET_SIZE(__pyx_v_result); if (unlikely(__pyx_t_5 == ((Py_ssize_t)-1))) __PYX_ERR(0, 689, __pyx_L1_error)
14726  __pyx_v_nslices = (__pyx_v_ndim - __pyx_t_5);
14727 
14728  /* "View.MemoryView":690
14729  *
14730  * nslices = ndim - len(result)
14731  * if nslices: # <<<<<<<<<<<<<<
14732  * result.extend([slice(None)] * nslices)
14733  *
14734  */
14735  __pyx_t_1 = (__pyx_v_nslices != 0);
14736  if (__pyx_t_1) {
14737 
14738  /* "View.MemoryView":691
14739  * nslices = ndim - len(result)
14740  * if nslices:
14741  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
14742  *
14743  * return have_slices or nslices, tuple(result)
14744  */
14745  __pyx_t_3 = PyList_New(1 * ((__pyx_v_nslices<0) ? 0:__pyx_v_nslices)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 691, __pyx_L1_error)
14746  __Pyx_GOTREF(__pyx_t_3);
14747  { Py_ssize_t __pyx_temp;
14748  for (__pyx_temp=0; __pyx_temp < __pyx_v_nslices; __pyx_temp++) {
14749  __Pyx_INCREF(__pyx_slice__29);
14750  __Pyx_GIVEREF(__pyx_slice__29);
14751  PyList_SET_ITEM(__pyx_t_3, __pyx_temp, __pyx_slice__29);
14752  }
14753  }
14754  __pyx_t_9 = __Pyx_PyList_Extend(__pyx_v_result, __pyx_t_3); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 691, __pyx_L1_error)
14755  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
14756 
14757  /* "View.MemoryView":690
14758  *
14759  * nslices = ndim - len(result)
14760  * if nslices: # <<<<<<<<<<<<<<
14761  * result.extend([slice(None)] * nslices)
14762  *
14763  */
14764  }
14765 
14766  /* "View.MemoryView":693
14767  * result.extend([slice(None)] * nslices)
14768  *
14769  * return have_slices or nslices, tuple(result) # <<<<<<<<<<<<<<
14770  *
14771  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14772  */
14773  __Pyx_XDECREF(__pyx_r);
14774  if (!__pyx_v_have_slices) {
14775  } else {
14776  __pyx_t_4 = __Pyx_PyBool_FromLong(__pyx_v_have_slices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
14777  __Pyx_GOTREF(__pyx_t_4);
14778  __pyx_t_3 = __pyx_t_4;
14779  __pyx_t_4 = 0;
14780  goto __pyx_L14_bool_binop_done;
14781  }
14782  __pyx_t_4 = PyInt_FromSsize_t(__pyx_v_nslices); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
14783  __Pyx_GOTREF(__pyx_t_4);
14784  __pyx_t_3 = __pyx_t_4;
14785  __pyx_t_4 = 0;
14786  __pyx_L14_bool_binop_done:;
14787  __pyx_t_4 = PyList_AsTuple(__pyx_v_result); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 693, __pyx_L1_error)
14788  __Pyx_GOTREF(__pyx_t_4);
14789  __pyx_t_11 = PyTuple_New(2); if (unlikely(!__pyx_t_11)) __PYX_ERR(0, 693, __pyx_L1_error)
14790  __Pyx_GOTREF(__pyx_t_11);
14791  __Pyx_GIVEREF(__pyx_t_3);
14792  PyTuple_SET_ITEM(__pyx_t_11, 0, __pyx_t_3);
14793  __Pyx_GIVEREF(__pyx_t_4);
14794  PyTuple_SET_ITEM(__pyx_t_11, 1, __pyx_t_4);
14795  __pyx_t_3 = 0;
14796  __pyx_t_4 = 0;
14797  __pyx_r = ((PyObject*)__pyx_t_11);
14798  __pyx_t_11 = 0;
14799  goto __pyx_L0;
14800 
14801  /* "View.MemoryView":661
14802  * return isinstance(o, memoryview)
14803  *
14804  * cdef tuple _unellipsify(object index, int ndim): # <<<<<<<<<<<<<<
14805  * """
14806  * Replace all ellipses with full slices and fill incomplete indices with
14807  */
14808 
14809  /* function exit code */
14810  __pyx_L1_error:;
14811  __Pyx_XDECREF(__pyx_t_3);
14812  __Pyx_XDECREF(__pyx_t_4);
14813  __Pyx_XDECREF(__pyx_t_7);
14814  __Pyx_XDECREF(__pyx_t_11);
14815  __Pyx_AddTraceback("View.MemoryView._unellipsify", __pyx_clineno, __pyx_lineno, __pyx_filename);
14816  __pyx_r = 0;
14817  __pyx_L0:;
14818  __Pyx_XDECREF(__pyx_v_tup);
14819  __Pyx_XDECREF(__pyx_v_result);
14820  __Pyx_XDECREF(__pyx_v_idx);
14821  __Pyx_XDECREF(__pyx_v_item);
14822  __Pyx_XGIVEREF(__pyx_r);
14823  __Pyx_RefNannyFinishContext();
14824  return __pyx_r;
14825 }
14826 
14827 /* "View.MemoryView":695
14828  * return have_slices or nslices, tuple(result)
14829  *
14830  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14831  * for suboffset in suboffsets[:ndim]:
14832  * if suboffset >= 0:
14833  */
14834 
14835 static PyObject *assert_direct_dimensions(Py_ssize_t *__pyx_v_suboffsets, int __pyx_v_ndim) {
14836  Py_ssize_t __pyx_v_suboffset;
14837  PyObject *__pyx_r = NULL;
14838  __Pyx_RefNannyDeclarations
14839  Py_ssize_t *__pyx_t_1;
14840  Py_ssize_t *__pyx_t_2;
14841  Py_ssize_t *__pyx_t_3;
14842  int __pyx_t_4;
14843  PyObject *__pyx_t_5 = NULL;
14844  __Pyx_RefNannySetupContext("assert_direct_dimensions", 0);
14845 
14846  /* "View.MemoryView":696
14847  *
14848  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14849  * for suboffset in suboffsets[:ndim]: # <<<<<<<<<<<<<<
14850  * if suboffset >= 0:
14851  * raise ValueError("Indirect dimensions not supported")
14852  */
14853  __pyx_t_2 = (__pyx_v_suboffsets + __pyx_v_ndim);
14854  for (__pyx_t_3 = __pyx_v_suboffsets; __pyx_t_3 < __pyx_t_2; __pyx_t_3++) {
14855  __pyx_t_1 = __pyx_t_3;
14856  __pyx_v_suboffset = (__pyx_t_1[0]);
14857 
14858  /* "View.MemoryView":697
14859  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14860  * for suboffset in suboffsets[:ndim]:
14861  * if suboffset >= 0: # <<<<<<<<<<<<<<
14862  * raise ValueError("Indirect dimensions not supported")
14863  *
14864  */
14865  __pyx_t_4 = ((__pyx_v_suboffset >= 0) != 0);
14866  if (unlikely(__pyx_t_4)) {
14867 
14868  /* "View.MemoryView":698
14869  * for suboffset in suboffsets[:ndim]:
14870  * if suboffset >= 0:
14871  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
14872  *
14873  *
14874  */
14875  __pyx_t_5 = __Pyx_PyObject_Call(__pyx_builtin_ValueError, __pyx_tuple__30, NULL); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 698, __pyx_L1_error)
14876  __Pyx_GOTREF(__pyx_t_5);
14877  __Pyx_Raise(__pyx_t_5, 0, 0, 0);
14878  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
14879  __PYX_ERR(0, 698, __pyx_L1_error)
14880 
14881  /* "View.MemoryView":697
14882  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim):
14883  * for suboffset in suboffsets[:ndim]:
14884  * if suboffset >= 0: # <<<<<<<<<<<<<<
14885  * raise ValueError("Indirect dimensions not supported")
14886  *
14887  */
14888  }
14889  }
14890 
14891  /* "View.MemoryView":695
14892  * return have_slices or nslices, tuple(result)
14893  *
14894  * cdef assert_direct_dimensions(Py_ssize_t *suboffsets, int ndim): # <<<<<<<<<<<<<<
14895  * for suboffset in suboffsets[:ndim]:
14896  * if suboffset >= 0:
14897  */
14898 
14899  /* function exit code */
14900  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
14901  goto __pyx_L0;
14902  __pyx_L1_error:;
14903  __Pyx_XDECREF(__pyx_t_5);
14904  __Pyx_AddTraceback("View.MemoryView.assert_direct_dimensions", __pyx_clineno, __pyx_lineno, __pyx_filename);
14905  __pyx_r = 0;
14906  __pyx_L0:;
14907  __Pyx_XGIVEREF(__pyx_r);
14908  __Pyx_RefNannyFinishContext();
14909  return __pyx_r;
14910 }
14911 
14912 /* "View.MemoryView":705
14913  *
14914  * @cname('__pyx_memview_slice')
14915  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
14916  * cdef int new_ndim = 0, suboffset_dim = -1, dim
14917  * cdef bint negative_step
14918  */
14919 
14920 static struct __pyx_memoryview_obj *__pyx_memview_slice(struct __pyx_memoryview_obj *__pyx_v_memview, PyObject *__pyx_v_indices) {
14921  int __pyx_v_new_ndim;
14922  int __pyx_v_suboffset_dim;
14923  int __pyx_v_dim;
14924  __Pyx_memviewslice __pyx_v_src;
14925  __Pyx_memviewslice __pyx_v_dst;
14926  __Pyx_memviewslice *__pyx_v_p_src;
14927  struct __pyx_memoryviewslice_obj *__pyx_v_memviewsliceobj = 0;
14928  __Pyx_memviewslice *__pyx_v_p_dst;
14929  int *__pyx_v_p_suboffset_dim;
14930  Py_ssize_t __pyx_v_start;
14931  Py_ssize_t __pyx_v_stop;
14932  Py_ssize_t __pyx_v_step;
14933  int __pyx_v_have_start;
14934  int __pyx_v_have_stop;
14935  int __pyx_v_have_step;
14936  PyObject *__pyx_v_index = NULL;
14937  struct __pyx_memoryview_obj *__pyx_r = NULL;
14938  __Pyx_RefNannyDeclarations
14939  int __pyx_t_1;
14940  int __pyx_t_2;
14941  PyObject *__pyx_t_3 = NULL;
14942  struct __pyx_memoryview_obj *__pyx_t_4;
14943  char *__pyx_t_5;
14944  int __pyx_t_6;
14945  Py_ssize_t __pyx_t_7;
14946  PyObject *(*__pyx_t_8)(PyObject *);
14947  PyObject *__pyx_t_9 = NULL;
14948  Py_ssize_t __pyx_t_10;
14949  int __pyx_t_11;
14950  Py_ssize_t __pyx_t_12;
14951  __Pyx_RefNannySetupContext("memview_slice", 0);
14952 
14953  /* "View.MemoryView":706
14954  * @cname('__pyx_memview_slice')
14955  * cdef memoryview memview_slice(memoryview memview, object indices):
14956  * cdef int new_ndim = 0, suboffset_dim = -1, dim # <<<<<<<<<<<<<<
14957  * cdef bint negative_step
14958  * cdef __Pyx_memviewslice src, dst
14959  */
14960  __pyx_v_new_ndim = 0;
14961  __pyx_v_suboffset_dim = -1;
14962 
14963  /* "View.MemoryView":713
14964  *
14965  *
14966  * memset(&dst, 0, sizeof(dst)) # <<<<<<<<<<<<<<
14967  *
14968  * cdef _memoryviewslice memviewsliceobj
14969  */
14970  (void)(memset((&__pyx_v_dst), 0, (sizeof(__pyx_v_dst))));
14971 
14972  /* "View.MemoryView":717
14973  * cdef _memoryviewslice memviewsliceobj
14974  *
14975  * assert memview.view.ndim > 0 # <<<<<<<<<<<<<<
14976  *
14977  * if isinstance(memview, _memoryviewslice):
14978  */
14979  #ifndef CYTHON_WITHOUT_ASSERTIONS
14980  if (unlikely(!Py_OptimizeFlag)) {
14981  if (unlikely(!((__pyx_v_memview->view.ndim > 0) != 0))) {
14982  PyErr_SetNone(PyExc_AssertionError);
14983  __PYX_ERR(0, 717, __pyx_L1_error)
14984  }
14985  }
14986  #endif
14987 
14988  /* "View.MemoryView":719
14989  * assert memview.view.ndim > 0
14990  *
14991  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
14992  * memviewsliceobj = memview
14993  * p_src = &memviewsliceobj.from_slice
14994  */
14995  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
14996  __pyx_t_2 = (__pyx_t_1 != 0);
14997  if (__pyx_t_2) {
14998 
14999  /* "View.MemoryView":720
15000  *
15001  * if isinstance(memview, _memoryviewslice):
15002  * memviewsliceobj = memview # <<<<<<<<<<<<<<
15003  * p_src = &memviewsliceobj.from_slice
15004  * else:
15005  */
15006  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 720, __pyx_L1_error)
15007  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
15008  __Pyx_INCREF(__pyx_t_3);
15009  __pyx_v_memviewsliceobj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
15010  __pyx_t_3 = 0;
15011 
15012  /* "View.MemoryView":721
15013  * if isinstance(memview, _memoryviewslice):
15014  * memviewsliceobj = memview
15015  * p_src = &memviewsliceobj.from_slice # <<<<<<<<<<<<<<
15016  * else:
15017  * slice_copy(memview, &src)
15018  */
15019  __pyx_v_p_src = (&__pyx_v_memviewsliceobj->from_slice);
15020 
15021  /* "View.MemoryView":719
15022  * assert memview.view.ndim > 0
15023  *
15024  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15025  * memviewsliceobj = memview
15026  * p_src = &memviewsliceobj.from_slice
15027  */
15028  goto __pyx_L3;
15029  }
15030 
15031  /* "View.MemoryView":723
15032  * p_src = &memviewsliceobj.from_slice
15033  * else:
15034  * slice_copy(memview, &src) # <<<<<<<<<<<<<<
15035  * p_src = &src
15036  *
15037  */
15038  /*else*/ {
15039  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_src));
15040 
15041  /* "View.MemoryView":724
15042  * else:
15043  * slice_copy(memview, &src)
15044  * p_src = &src # <<<<<<<<<<<<<<
15045  *
15046  *
15047  */
15048  __pyx_v_p_src = (&__pyx_v_src);
15049  }
15050  __pyx_L3:;
15051 
15052  /* "View.MemoryView":730
15053  *
15054  *
15055  * dst.memview = p_src.memview # <<<<<<<<<<<<<<
15056  * dst.data = p_src.data
15057  *
15058  */
15059  __pyx_t_4 = __pyx_v_p_src->memview;
15060  __pyx_v_dst.memview = __pyx_t_4;
15061 
15062  /* "View.MemoryView":731
15063  *
15064  * dst.memview = p_src.memview
15065  * dst.data = p_src.data # <<<<<<<<<<<<<<
15066  *
15067  *
15068  */
15069  __pyx_t_5 = __pyx_v_p_src->data;
15070  __pyx_v_dst.data = __pyx_t_5;
15071 
15072  /* "View.MemoryView":736
15073  *
15074  *
15075  * cdef __Pyx_memviewslice *p_dst = &dst # <<<<<<<<<<<<<<
15076  * cdef int *p_suboffset_dim = &suboffset_dim
15077  * cdef Py_ssize_t start, stop, step
15078  */
15079  __pyx_v_p_dst = (&__pyx_v_dst);
15080 
15081  /* "View.MemoryView":737
15082  *
15083  * cdef __Pyx_memviewslice *p_dst = &dst
15084  * cdef int *p_suboffset_dim = &suboffset_dim # <<<<<<<<<<<<<<
15085  * cdef Py_ssize_t start, stop, step
15086  * cdef bint have_start, have_stop, have_step
15087  */
15088  __pyx_v_p_suboffset_dim = (&__pyx_v_suboffset_dim);
15089 
15090  /* "View.MemoryView":741
15091  * cdef bint have_start, have_stop, have_step
15092  *
15093  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15094  * if PyIndex_Check(index):
15095  * slice_memviewslice(
15096  */
15097  __pyx_t_6 = 0;
15098  if (likely(PyList_CheckExact(__pyx_v_indices)) || PyTuple_CheckExact(__pyx_v_indices)) {
15099  __pyx_t_3 = __pyx_v_indices; __Pyx_INCREF(__pyx_t_3); __pyx_t_7 = 0;
15100  __pyx_t_8 = NULL;
15101  } else {
15102  __pyx_t_7 = -1; __pyx_t_3 = PyObject_GetIter(__pyx_v_indices); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 741, __pyx_L1_error)
15103  __Pyx_GOTREF(__pyx_t_3);
15104  __pyx_t_8 = Py_TYPE(__pyx_t_3)->tp_iternext; if (unlikely(!__pyx_t_8)) __PYX_ERR(0, 741, __pyx_L1_error)
15105  }
15106  for (;;) {
15107  if (likely(!__pyx_t_8)) {
15108  if (likely(PyList_CheckExact(__pyx_t_3))) {
15109  if (__pyx_t_7 >= PyList_GET_SIZE(__pyx_t_3)) break;
15110  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15111  __pyx_t_9 = PyList_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 741, __pyx_L1_error)
15112  #else
15113  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 741, __pyx_L1_error)
15114  __Pyx_GOTREF(__pyx_t_9);
15115  #endif
15116  } else {
15117  if (__pyx_t_7 >= PyTuple_GET_SIZE(__pyx_t_3)) break;
15118  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
15119  __pyx_t_9 = PyTuple_GET_ITEM(__pyx_t_3, __pyx_t_7); __Pyx_INCREF(__pyx_t_9); __pyx_t_7++; if (unlikely(0 < 0)) __PYX_ERR(0, 741, __pyx_L1_error)
15120  #else
15121  __pyx_t_9 = PySequence_ITEM(__pyx_t_3, __pyx_t_7); __pyx_t_7++; if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 741, __pyx_L1_error)
15122  __Pyx_GOTREF(__pyx_t_9);
15123  #endif
15124  }
15125  } else {
15126  __pyx_t_9 = __pyx_t_8(__pyx_t_3);
15127  if (unlikely(!__pyx_t_9)) {
15128  PyObject* exc_type = PyErr_Occurred();
15129  if (exc_type) {
15130  if (likely(__Pyx_PyErr_GivenExceptionMatches(exc_type, PyExc_StopIteration))) PyErr_Clear();
15131  else __PYX_ERR(0, 741, __pyx_L1_error)
15132  }
15133  break;
15134  }
15135  __Pyx_GOTREF(__pyx_t_9);
15136  }
15137  __Pyx_XDECREF_SET(__pyx_v_index, __pyx_t_9);
15138  __pyx_t_9 = 0;
15139  __pyx_v_dim = __pyx_t_6;
15140  __pyx_t_6 = (__pyx_t_6 + 1);
15141 
15142  /* "View.MemoryView":742
15143  *
15144  * for dim, index in enumerate(indices):
15145  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15146  * slice_memviewslice(
15147  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15148  */
15149  __pyx_t_2 = (PyIndex_Check(__pyx_v_index) != 0);
15150  if (__pyx_t_2) {
15151 
15152  /* "View.MemoryView":746
15153  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15154  * dim, new_ndim, p_suboffset_dim,
15155  * index, 0, 0, # start, stop, step # <<<<<<<<<<<<<<
15156  * 0, 0, 0, # have_{start,stop,step}
15157  * False)
15158  */
15159  __pyx_t_10 = __Pyx_PyIndex_AsSsize_t(__pyx_v_index); if (unlikely((__pyx_t_10 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 746, __pyx_L1_error)
15160 
15161  /* "View.MemoryView":743
15162  * for dim, index in enumerate(indices):
15163  * if PyIndex_Check(index):
15164  * slice_memviewslice( # <<<<<<<<<<<<<<
15165  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15166  * dim, new_ndim, p_suboffset_dim,
15167  */
15168  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_t_10, 0, 0, 0, 0, 0, 0); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 743, __pyx_L1_error)
15169 
15170  /* "View.MemoryView":742
15171  *
15172  * for dim, index in enumerate(indices):
15173  * if PyIndex_Check(index): # <<<<<<<<<<<<<<
15174  * slice_memviewslice(
15175  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15176  */
15177  goto __pyx_L6;
15178  }
15179 
15180  /* "View.MemoryView":749
15181  * 0, 0, 0, # have_{start,stop,step}
15182  * False)
15183  * elif index is None: # <<<<<<<<<<<<<<
15184  * p_dst.shape[new_ndim] = 1
15185  * p_dst.strides[new_ndim] = 0
15186  */
15187  __pyx_t_2 = (__pyx_v_index == Py_None);
15188  __pyx_t_1 = (__pyx_t_2 != 0);
15189  if (__pyx_t_1) {
15190 
15191  /* "View.MemoryView":750
15192  * False)
15193  * elif index is None:
15194  * p_dst.shape[new_ndim] = 1 # <<<<<<<<<<<<<<
15195  * p_dst.strides[new_ndim] = 0
15196  * p_dst.suboffsets[new_ndim] = -1
15197  */
15198  (__pyx_v_p_dst->shape[__pyx_v_new_ndim]) = 1;
15199 
15200  /* "View.MemoryView":751
15201  * elif index is None:
15202  * p_dst.shape[new_ndim] = 1
15203  * p_dst.strides[new_ndim] = 0 # <<<<<<<<<<<<<<
15204  * p_dst.suboffsets[new_ndim] = -1
15205  * new_ndim += 1
15206  */
15207  (__pyx_v_p_dst->strides[__pyx_v_new_ndim]) = 0;
15208 
15209  /* "View.MemoryView":752
15210  * p_dst.shape[new_ndim] = 1
15211  * p_dst.strides[new_ndim] = 0
15212  * p_dst.suboffsets[new_ndim] = -1 # <<<<<<<<<<<<<<
15213  * new_ndim += 1
15214  * else:
15215  */
15216  (__pyx_v_p_dst->suboffsets[__pyx_v_new_ndim]) = -1L;
15217 
15218  /* "View.MemoryView":753
15219  * p_dst.strides[new_ndim] = 0
15220  * p_dst.suboffsets[new_ndim] = -1
15221  * new_ndim += 1 # <<<<<<<<<<<<<<
15222  * else:
15223  * start = index.start or 0
15224  */
15225  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15226 
15227  /* "View.MemoryView":749
15228  * 0, 0, 0, # have_{start,stop,step}
15229  * False)
15230  * elif index is None: # <<<<<<<<<<<<<<
15231  * p_dst.shape[new_ndim] = 1
15232  * p_dst.strides[new_ndim] = 0
15233  */
15234  goto __pyx_L6;
15235  }
15236 
15237  /* "View.MemoryView":755
15238  * new_ndim += 1
15239  * else:
15240  * start = index.start or 0 # <<<<<<<<<<<<<<
15241  * stop = index.stop or 0
15242  * step = index.step or 0
15243  */
15244  /*else*/ {
15245  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 755, __pyx_L1_error)
15246  __Pyx_GOTREF(__pyx_t_9);
15247  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 755, __pyx_L1_error)
15248  if (!__pyx_t_1) {
15249  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15250  } else {
15251  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 755, __pyx_L1_error)
15252  __pyx_t_10 = __pyx_t_12;
15253  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15254  goto __pyx_L7_bool_binop_done;
15255  }
15256  __pyx_t_10 = 0;
15257  __pyx_L7_bool_binop_done:;
15258  __pyx_v_start = __pyx_t_10;
15259 
15260  /* "View.MemoryView":756
15261  * else:
15262  * start = index.start or 0
15263  * stop = index.stop or 0 # <<<<<<<<<<<<<<
15264  * step = index.step or 0
15265  *
15266  */
15267  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 756, __pyx_L1_error)
15268  __Pyx_GOTREF(__pyx_t_9);
15269  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 756, __pyx_L1_error)
15270  if (!__pyx_t_1) {
15271  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15272  } else {
15273  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 756, __pyx_L1_error)
15274  __pyx_t_10 = __pyx_t_12;
15275  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15276  goto __pyx_L9_bool_binop_done;
15277  }
15278  __pyx_t_10 = 0;
15279  __pyx_L9_bool_binop_done:;
15280  __pyx_v_stop = __pyx_t_10;
15281 
15282  /* "View.MemoryView":757
15283  * start = index.start or 0
15284  * stop = index.stop or 0
15285  * step = index.step or 0 # <<<<<<<<<<<<<<
15286  *
15287  * have_start = index.start is not None
15288  */
15289  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 757, __pyx_L1_error)
15290  __Pyx_GOTREF(__pyx_t_9);
15291  __pyx_t_1 = __Pyx_PyObject_IsTrue(__pyx_t_9); if (unlikely(__pyx_t_1 < 0)) __PYX_ERR(0, 757, __pyx_L1_error)
15292  if (!__pyx_t_1) {
15293  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15294  } else {
15295  __pyx_t_12 = __Pyx_PyIndex_AsSsize_t(__pyx_t_9); if (unlikely((__pyx_t_12 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 757, __pyx_L1_error)
15296  __pyx_t_10 = __pyx_t_12;
15297  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15298  goto __pyx_L11_bool_binop_done;
15299  }
15300  __pyx_t_10 = 0;
15301  __pyx_L11_bool_binop_done:;
15302  __pyx_v_step = __pyx_t_10;
15303 
15304  /* "View.MemoryView":759
15305  * step = index.step or 0
15306  *
15307  * have_start = index.start is not None # <<<<<<<<<<<<<<
15308  * have_stop = index.stop is not None
15309  * have_step = index.step is not None
15310  */
15311  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_start); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 759, __pyx_L1_error)
15312  __Pyx_GOTREF(__pyx_t_9);
15313  __pyx_t_1 = (__pyx_t_9 != Py_None);
15314  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15315  __pyx_v_have_start = __pyx_t_1;
15316 
15317  /* "View.MemoryView":760
15318  *
15319  * have_start = index.start is not None
15320  * have_stop = index.stop is not None # <<<<<<<<<<<<<<
15321  * have_step = index.step is not None
15322  *
15323  */
15324  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_stop); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 760, __pyx_L1_error)
15325  __Pyx_GOTREF(__pyx_t_9);
15326  __pyx_t_1 = (__pyx_t_9 != Py_None);
15327  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15328  __pyx_v_have_stop = __pyx_t_1;
15329 
15330  /* "View.MemoryView":761
15331  * have_start = index.start is not None
15332  * have_stop = index.stop is not None
15333  * have_step = index.step is not None # <<<<<<<<<<<<<<
15334  *
15335  * slice_memviewslice(
15336  */
15337  __pyx_t_9 = __Pyx_PyObject_GetAttrStr(__pyx_v_index, __pyx_n_s_step); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 761, __pyx_L1_error)
15338  __Pyx_GOTREF(__pyx_t_9);
15339  __pyx_t_1 = (__pyx_t_9 != Py_None);
15340  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
15341  __pyx_v_have_step = __pyx_t_1;
15342 
15343  /* "View.MemoryView":763
15344  * have_step = index.step is not None
15345  *
15346  * slice_memviewslice( # <<<<<<<<<<<<<<
15347  * p_dst, p_src.shape[dim], p_src.strides[dim], p_src.suboffsets[dim],
15348  * dim, new_ndim, p_suboffset_dim,
15349  */
15350  __pyx_t_11 = __pyx_memoryview_slice_memviewslice(__pyx_v_p_dst, (__pyx_v_p_src->shape[__pyx_v_dim]), (__pyx_v_p_src->strides[__pyx_v_dim]), (__pyx_v_p_src->suboffsets[__pyx_v_dim]), __pyx_v_dim, __pyx_v_new_ndim, __pyx_v_p_suboffset_dim, __pyx_v_start, __pyx_v_stop, __pyx_v_step, __pyx_v_have_start, __pyx_v_have_stop, __pyx_v_have_step, 1); if (unlikely(__pyx_t_11 == ((int)-1))) __PYX_ERR(0, 763, __pyx_L1_error)
15351 
15352  /* "View.MemoryView":769
15353  * have_start, have_stop, have_step,
15354  * True)
15355  * new_ndim += 1 # <<<<<<<<<<<<<<
15356  *
15357  * if isinstance(memview, _memoryviewslice):
15358  */
15359  __pyx_v_new_ndim = (__pyx_v_new_ndim + 1);
15360  }
15361  __pyx_L6:;
15362 
15363  /* "View.MemoryView":741
15364  * cdef bint have_start, have_stop, have_step
15365  *
15366  * for dim, index in enumerate(indices): # <<<<<<<<<<<<<<
15367  * if PyIndex_Check(index):
15368  * slice_memviewslice(
15369  */
15370  }
15371  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
15372 
15373  /* "View.MemoryView":771
15374  * new_ndim += 1
15375  *
15376  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15377  * return memoryview_fromslice(dst, new_ndim,
15378  * memviewsliceobj.to_object_func,
15379  */
15380  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
15381  __pyx_t_2 = (__pyx_t_1 != 0);
15382  if (__pyx_t_2) {
15383 
15384  /* "View.MemoryView":772
15385  *
15386  * if isinstance(memview, _memoryviewslice):
15387  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15388  * memviewsliceobj.to_object_func,
15389  * memviewsliceobj.to_dtype_func,
15390  */
15391  __Pyx_XDECREF(((PyObject *)__pyx_r));
15392 
15393  /* "View.MemoryView":773
15394  * if isinstance(memview, _memoryviewslice):
15395  * return memoryview_fromslice(dst, new_ndim,
15396  * memviewsliceobj.to_object_func, # <<<<<<<<<<<<<<
15397  * memviewsliceobj.to_dtype_func,
15398  * memview.dtype_is_object)
15399  */
15400  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 773, __pyx_L1_error) }
15401 
15402  /* "View.MemoryView":774
15403  * return memoryview_fromslice(dst, new_ndim,
15404  * memviewsliceobj.to_object_func,
15405  * memviewsliceobj.to_dtype_func, # <<<<<<<<<<<<<<
15406  * memview.dtype_is_object)
15407  * else:
15408  */
15409  if (unlikely(!__pyx_v_memviewsliceobj)) { __Pyx_RaiseUnboundLocalError("memviewsliceobj"); __PYX_ERR(0, 774, __pyx_L1_error) }
15410 
15411  /* "View.MemoryView":772
15412  *
15413  * if isinstance(memview, _memoryviewslice):
15414  * return memoryview_fromslice(dst, new_ndim, # <<<<<<<<<<<<<<
15415  * memviewsliceobj.to_object_func,
15416  * memviewsliceobj.to_dtype_func,
15417  */
15418  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, __pyx_v_memviewsliceobj->to_object_func, __pyx_v_memviewsliceobj->to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 772, __pyx_L1_error)
15419  __Pyx_GOTREF(__pyx_t_3);
15420  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 772, __pyx_L1_error)
15421  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15422  __pyx_t_3 = 0;
15423  goto __pyx_L0;
15424 
15425  /* "View.MemoryView":771
15426  * new_ndim += 1
15427  *
15428  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
15429  * return memoryview_fromslice(dst, new_ndim,
15430  * memviewsliceobj.to_object_func,
15431  */
15432  }
15433 
15434  /* "View.MemoryView":777
15435  * memview.dtype_is_object)
15436  * else:
15437  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15438  * memview.dtype_is_object)
15439  *
15440  */
15441  /*else*/ {
15442  __Pyx_XDECREF(((PyObject *)__pyx_r));
15443 
15444  /* "View.MemoryView":778
15445  * else:
15446  * return memoryview_fromslice(dst, new_ndim, NULL, NULL,
15447  * memview.dtype_is_object) # <<<<<<<<<<<<<<
15448  *
15449  *
15450  */
15451  __pyx_t_3 = __pyx_memoryview_fromslice(__pyx_v_dst, __pyx_v_new_ndim, NULL, NULL, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 777, __pyx_L1_error)
15452  __Pyx_GOTREF(__pyx_t_3);
15453 
15454  /* "View.MemoryView":777
15455  * memview.dtype_is_object)
15456  * else:
15457  * return memoryview_fromslice(dst, new_ndim, NULL, NULL, # <<<<<<<<<<<<<<
15458  * memview.dtype_is_object)
15459  *
15460  */
15461  if (!(likely(((__pyx_t_3) == Py_None) || likely(__Pyx_TypeTest(__pyx_t_3, __pyx_memoryview_type))))) __PYX_ERR(0, 777, __pyx_L1_error)
15462  __pyx_r = ((struct __pyx_memoryview_obj *)__pyx_t_3);
15463  __pyx_t_3 = 0;
15464  goto __pyx_L0;
15465  }
15466 
15467  /* "View.MemoryView":705
15468  *
15469  * @cname('__pyx_memview_slice')
15470  * cdef memoryview memview_slice(memoryview memview, object indices): # <<<<<<<<<<<<<<
15471  * cdef int new_ndim = 0, suboffset_dim = -1, dim
15472  * cdef bint negative_step
15473  */
15474 
15475  /* function exit code */
15476  __pyx_L1_error:;
15477  __Pyx_XDECREF(__pyx_t_3);
15478  __Pyx_XDECREF(__pyx_t_9);
15479  __Pyx_AddTraceback("View.MemoryView.memview_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
15480  __pyx_r = 0;
15481  __pyx_L0:;
15482  __Pyx_XDECREF((PyObject *)__pyx_v_memviewsliceobj);
15483  __Pyx_XDECREF(__pyx_v_index);
15484  __Pyx_XGIVEREF((PyObject *)__pyx_r);
15485  __Pyx_RefNannyFinishContext();
15486  return __pyx_r;
15487 }
15488 
15489 /* "View.MemoryView":802
15490  *
15491  * @cname('__pyx_memoryview_slice_memviewslice')
15492  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
15493  * __Pyx_memviewslice *dst,
15494  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
15495  */
15496 
15497 static int __pyx_memoryview_slice_memviewslice(__Pyx_memviewslice *__pyx_v_dst, Py_ssize_t __pyx_v_shape, Py_ssize_t __pyx_v_stride, Py_ssize_t __pyx_v_suboffset, int __pyx_v_dim, int __pyx_v_new_ndim, int *__pyx_v_suboffset_dim, Py_ssize_t __pyx_v_start, Py_ssize_t __pyx_v_stop, Py_ssize_t __pyx_v_step, int __pyx_v_have_start, int __pyx_v_have_stop, int __pyx_v_have_step, int __pyx_v_is_slice) {
15498  Py_ssize_t __pyx_v_new_shape;
15499  int __pyx_v_negative_step;
15500  int __pyx_r;
15501  int __pyx_t_1;
15502  int __pyx_t_2;
15503  int __pyx_t_3;
15504 
15505  /* "View.MemoryView":822
15506  * cdef bint negative_step
15507  *
15508  * if not is_slice: # <<<<<<<<<<<<<<
15509  *
15510  * if start < 0:
15511  */
15512  __pyx_t_1 = ((!(__pyx_v_is_slice != 0)) != 0);
15513  if (__pyx_t_1) {
15514 
15515  /* "View.MemoryView":824
15516  * if not is_slice:
15517  *
15518  * if start < 0: # <<<<<<<<<<<<<<
15519  * start += shape
15520  * if not 0 <= start < shape:
15521  */
15522  __pyx_t_1 = ((__pyx_v_start < 0) != 0);
15523  if (__pyx_t_1) {
15524 
15525  /* "View.MemoryView":825
15526  *
15527  * if start < 0:
15528  * start += shape # <<<<<<<<<<<<<<
15529  * if not 0 <= start < shape:
15530  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15531  */
15532  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15533 
15534  /* "View.MemoryView":824
15535  * if not is_slice:
15536  *
15537  * if start < 0: # <<<<<<<<<<<<<<
15538  * start += shape
15539  * if not 0 <= start < shape:
15540  */
15541  }
15542 
15543  /* "View.MemoryView":826
15544  * if start < 0:
15545  * start += shape
15546  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15547  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15548  * else:
15549  */
15550  __pyx_t_1 = (0 <= __pyx_v_start);
15551  if (__pyx_t_1) {
15552  __pyx_t_1 = (__pyx_v_start < __pyx_v_shape);
15553  }
15554  __pyx_t_2 = ((!(__pyx_t_1 != 0)) != 0);
15555  if (__pyx_t_2) {
15556 
15557  /* "View.MemoryView":827
15558  * start += shape
15559  * if not 0 <= start < shape:
15560  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim) # <<<<<<<<<<<<<<
15561  * else:
15562  *
15563  */
15564  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"Index out of bounds (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 827, __pyx_L1_error)
15565 
15566  /* "View.MemoryView":826
15567  * if start < 0:
15568  * start += shape
15569  * if not 0 <= start < shape: # <<<<<<<<<<<<<<
15570  * _err_dim(IndexError, "Index out of bounds (axis %d)", dim)
15571  * else:
15572  */
15573  }
15574 
15575  /* "View.MemoryView":822
15576  * cdef bint negative_step
15577  *
15578  * if not is_slice: # <<<<<<<<<<<<<<
15579  *
15580  * if start < 0:
15581  */
15582  goto __pyx_L3;
15583  }
15584 
15585  /* "View.MemoryView":830
15586  * else:
15587  *
15588  * negative_step = have_step != 0 and step < 0 # <<<<<<<<<<<<<<
15589  *
15590  * if have_step and step == 0:
15591  */
15592  /*else*/ {
15593  __pyx_t_1 = ((__pyx_v_have_step != 0) != 0);
15594  if (__pyx_t_1) {
15595  } else {
15596  __pyx_t_2 = __pyx_t_1;
15597  goto __pyx_L6_bool_binop_done;
15598  }
15599  __pyx_t_1 = ((__pyx_v_step < 0) != 0);
15600  __pyx_t_2 = __pyx_t_1;
15601  __pyx_L6_bool_binop_done:;
15602  __pyx_v_negative_step = __pyx_t_2;
15603 
15604  /* "View.MemoryView":832
15605  * negative_step = have_step != 0 and step < 0
15606  *
15607  * if have_step and step == 0: # <<<<<<<<<<<<<<
15608  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15609  *
15610  */
15611  __pyx_t_1 = (__pyx_v_have_step != 0);
15612  if (__pyx_t_1) {
15613  } else {
15614  __pyx_t_2 = __pyx_t_1;
15615  goto __pyx_L9_bool_binop_done;
15616  }
15617  __pyx_t_1 = ((__pyx_v_step == 0) != 0);
15618  __pyx_t_2 = __pyx_t_1;
15619  __pyx_L9_bool_binop_done:;
15620  if (__pyx_t_2) {
15621 
15622  /* "View.MemoryView":833
15623  *
15624  * if have_step and step == 0:
15625  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim) # <<<<<<<<<<<<<<
15626  *
15627  *
15628  */
15629  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Step may not be zero (axis %d)"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 833, __pyx_L1_error)
15630 
15631  /* "View.MemoryView":832
15632  * negative_step = have_step != 0 and step < 0
15633  *
15634  * if have_step and step == 0: # <<<<<<<<<<<<<<
15635  * _err_dim(ValueError, "Step may not be zero (axis %d)", dim)
15636  *
15637  */
15638  }
15639 
15640  /* "View.MemoryView":836
15641  *
15642  *
15643  * if have_start: # <<<<<<<<<<<<<<
15644  * if start < 0:
15645  * start += shape
15646  */
15647  __pyx_t_2 = (__pyx_v_have_start != 0);
15648  if (__pyx_t_2) {
15649 
15650  /* "View.MemoryView":837
15651  *
15652  * if have_start:
15653  * if start < 0: # <<<<<<<<<<<<<<
15654  * start += shape
15655  * if start < 0:
15656  */
15657  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15658  if (__pyx_t_2) {
15659 
15660  /* "View.MemoryView":838
15661  * if have_start:
15662  * if start < 0:
15663  * start += shape # <<<<<<<<<<<<<<
15664  * if start < 0:
15665  * start = 0
15666  */
15667  __pyx_v_start = (__pyx_v_start + __pyx_v_shape);
15668 
15669  /* "View.MemoryView":839
15670  * if start < 0:
15671  * start += shape
15672  * if start < 0: # <<<<<<<<<<<<<<
15673  * start = 0
15674  * elif start >= shape:
15675  */
15676  __pyx_t_2 = ((__pyx_v_start < 0) != 0);
15677  if (__pyx_t_2) {
15678 
15679  /* "View.MemoryView":840
15680  * start += shape
15681  * if start < 0:
15682  * start = 0 # <<<<<<<<<<<<<<
15683  * elif start >= shape:
15684  * if negative_step:
15685  */
15686  __pyx_v_start = 0;
15687 
15688  /* "View.MemoryView":839
15689  * if start < 0:
15690  * start += shape
15691  * if start < 0: # <<<<<<<<<<<<<<
15692  * start = 0
15693  * elif start >= shape:
15694  */
15695  }
15696 
15697  /* "View.MemoryView":837
15698  *
15699  * if have_start:
15700  * if start < 0: # <<<<<<<<<<<<<<
15701  * start += shape
15702  * if start < 0:
15703  */
15704  goto __pyx_L12;
15705  }
15706 
15707  /* "View.MemoryView":841
15708  * if start < 0:
15709  * start = 0
15710  * elif start >= shape: # <<<<<<<<<<<<<<
15711  * if negative_step:
15712  * start = shape - 1
15713  */
15714  __pyx_t_2 = ((__pyx_v_start >= __pyx_v_shape) != 0);
15715  if (__pyx_t_2) {
15716 
15717  /* "View.MemoryView":842
15718  * start = 0
15719  * elif start >= shape:
15720  * if negative_step: # <<<<<<<<<<<<<<
15721  * start = shape - 1
15722  * else:
15723  */
15724  __pyx_t_2 = (__pyx_v_negative_step != 0);
15725  if (__pyx_t_2) {
15726 
15727  /* "View.MemoryView":843
15728  * elif start >= shape:
15729  * if negative_step:
15730  * start = shape - 1 # <<<<<<<<<<<<<<
15731  * else:
15732  * start = shape
15733  */
15734  __pyx_v_start = (__pyx_v_shape - 1);
15735 
15736  /* "View.MemoryView":842
15737  * start = 0
15738  * elif start >= shape:
15739  * if negative_step: # <<<<<<<<<<<<<<
15740  * start = shape - 1
15741  * else:
15742  */
15743  goto __pyx_L14;
15744  }
15745 
15746  /* "View.MemoryView":845
15747  * start = shape - 1
15748  * else:
15749  * start = shape # <<<<<<<<<<<<<<
15750  * else:
15751  * if negative_step:
15752  */
15753  /*else*/ {
15754  __pyx_v_start = __pyx_v_shape;
15755  }
15756  __pyx_L14:;
15757 
15758  /* "View.MemoryView":841
15759  * if start < 0:
15760  * start = 0
15761  * elif start >= shape: # <<<<<<<<<<<<<<
15762  * if negative_step:
15763  * start = shape - 1
15764  */
15765  }
15766  __pyx_L12:;
15767 
15768  /* "View.MemoryView":836
15769  *
15770  *
15771  * if have_start: # <<<<<<<<<<<<<<
15772  * if start < 0:
15773  * start += shape
15774  */
15775  goto __pyx_L11;
15776  }
15777 
15778  /* "View.MemoryView":847
15779  * start = shape
15780  * else:
15781  * if negative_step: # <<<<<<<<<<<<<<
15782  * start = shape - 1
15783  * else:
15784  */
15785  /*else*/ {
15786  __pyx_t_2 = (__pyx_v_negative_step != 0);
15787  if (__pyx_t_2) {
15788 
15789  /* "View.MemoryView":848
15790  * else:
15791  * if negative_step:
15792  * start = shape - 1 # <<<<<<<<<<<<<<
15793  * else:
15794  * start = 0
15795  */
15796  __pyx_v_start = (__pyx_v_shape - 1);
15797 
15798  /* "View.MemoryView":847
15799  * start = shape
15800  * else:
15801  * if negative_step: # <<<<<<<<<<<<<<
15802  * start = shape - 1
15803  * else:
15804  */
15805  goto __pyx_L15;
15806  }
15807 
15808  /* "View.MemoryView":850
15809  * start = shape - 1
15810  * else:
15811  * start = 0 # <<<<<<<<<<<<<<
15812  *
15813  * if have_stop:
15814  */
15815  /*else*/ {
15816  __pyx_v_start = 0;
15817  }
15818  __pyx_L15:;
15819  }
15820  __pyx_L11:;
15821 
15822  /* "View.MemoryView":852
15823  * start = 0
15824  *
15825  * if have_stop: # <<<<<<<<<<<<<<
15826  * if stop < 0:
15827  * stop += shape
15828  */
15829  __pyx_t_2 = (__pyx_v_have_stop != 0);
15830  if (__pyx_t_2) {
15831 
15832  /* "View.MemoryView":853
15833  *
15834  * if have_stop:
15835  * if stop < 0: # <<<<<<<<<<<<<<
15836  * stop += shape
15837  * if stop < 0:
15838  */
15839  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15840  if (__pyx_t_2) {
15841 
15842  /* "View.MemoryView":854
15843  * if have_stop:
15844  * if stop < 0:
15845  * stop += shape # <<<<<<<<<<<<<<
15846  * if stop < 0:
15847  * stop = 0
15848  */
15849  __pyx_v_stop = (__pyx_v_stop + __pyx_v_shape);
15850 
15851  /* "View.MemoryView":855
15852  * if stop < 0:
15853  * stop += shape
15854  * if stop < 0: # <<<<<<<<<<<<<<
15855  * stop = 0
15856  * elif stop > shape:
15857  */
15858  __pyx_t_2 = ((__pyx_v_stop < 0) != 0);
15859  if (__pyx_t_2) {
15860 
15861  /* "View.MemoryView":856
15862  * stop += shape
15863  * if stop < 0:
15864  * stop = 0 # <<<<<<<<<<<<<<
15865  * elif stop > shape:
15866  * stop = shape
15867  */
15868  __pyx_v_stop = 0;
15869 
15870  /* "View.MemoryView":855
15871  * if stop < 0:
15872  * stop += shape
15873  * if stop < 0: # <<<<<<<<<<<<<<
15874  * stop = 0
15875  * elif stop > shape:
15876  */
15877  }
15878 
15879  /* "View.MemoryView":853
15880  *
15881  * if have_stop:
15882  * if stop < 0: # <<<<<<<<<<<<<<
15883  * stop += shape
15884  * if stop < 0:
15885  */
15886  goto __pyx_L17;
15887  }
15888 
15889  /* "View.MemoryView":857
15890  * if stop < 0:
15891  * stop = 0
15892  * elif stop > shape: # <<<<<<<<<<<<<<
15893  * stop = shape
15894  * else:
15895  */
15896  __pyx_t_2 = ((__pyx_v_stop > __pyx_v_shape) != 0);
15897  if (__pyx_t_2) {
15898 
15899  /* "View.MemoryView":858
15900  * stop = 0
15901  * elif stop > shape:
15902  * stop = shape # <<<<<<<<<<<<<<
15903  * else:
15904  * if negative_step:
15905  */
15906  __pyx_v_stop = __pyx_v_shape;
15907 
15908  /* "View.MemoryView":857
15909  * if stop < 0:
15910  * stop = 0
15911  * elif stop > shape: # <<<<<<<<<<<<<<
15912  * stop = shape
15913  * else:
15914  */
15915  }
15916  __pyx_L17:;
15917 
15918  /* "View.MemoryView":852
15919  * start = 0
15920  *
15921  * if have_stop: # <<<<<<<<<<<<<<
15922  * if stop < 0:
15923  * stop += shape
15924  */
15925  goto __pyx_L16;
15926  }
15927 
15928  /* "View.MemoryView":860
15929  * stop = shape
15930  * else:
15931  * if negative_step: # <<<<<<<<<<<<<<
15932  * stop = -1
15933  * else:
15934  */
15935  /*else*/ {
15936  __pyx_t_2 = (__pyx_v_negative_step != 0);
15937  if (__pyx_t_2) {
15938 
15939  /* "View.MemoryView":861
15940  * else:
15941  * if negative_step:
15942  * stop = -1 # <<<<<<<<<<<<<<
15943  * else:
15944  * stop = shape
15945  */
15946  __pyx_v_stop = -1L;
15947 
15948  /* "View.MemoryView":860
15949  * stop = shape
15950  * else:
15951  * if negative_step: # <<<<<<<<<<<<<<
15952  * stop = -1
15953  * else:
15954  */
15955  goto __pyx_L19;
15956  }
15957 
15958  /* "View.MemoryView":863
15959  * stop = -1
15960  * else:
15961  * stop = shape # <<<<<<<<<<<<<<
15962  *
15963  * if not have_step:
15964  */
15965  /*else*/ {
15966  __pyx_v_stop = __pyx_v_shape;
15967  }
15968  __pyx_L19:;
15969  }
15970  __pyx_L16:;
15971 
15972  /* "View.MemoryView":865
15973  * stop = shape
15974  *
15975  * if not have_step: # <<<<<<<<<<<<<<
15976  * step = 1
15977  *
15978  */
15979  __pyx_t_2 = ((!(__pyx_v_have_step != 0)) != 0);
15980  if (__pyx_t_2) {
15981 
15982  /* "View.MemoryView":866
15983  *
15984  * if not have_step:
15985  * step = 1 # <<<<<<<<<<<<<<
15986  *
15987  *
15988  */
15989  __pyx_v_step = 1;
15990 
15991  /* "View.MemoryView":865
15992  * stop = shape
15993  *
15994  * if not have_step: # <<<<<<<<<<<<<<
15995  * step = 1
15996  *
15997  */
15998  }
15999 
16000  /* "View.MemoryView":870
16001  *
16002  * with cython.cdivision(True):
16003  * new_shape = (stop - start) // step # <<<<<<<<<<<<<<
16004  *
16005  * if (stop - start) - step * new_shape:
16006  */
16007  __pyx_v_new_shape = ((__pyx_v_stop - __pyx_v_start) / __pyx_v_step);
16008 
16009  /* "View.MemoryView":872
16010  * new_shape = (stop - start) // step
16011  *
16012  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16013  * new_shape += 1
16014  *
16015  */
16016  __pyx_t_2 = (((__pyx_v_stop - __pyx_v_start) - (__pyx_v_step * __pyx_v_new_shape)) != 0);
16017  if (__pyx_t_2) {
16018 
16019  /* "View.MemoryView":873
16020  *
16021  * if (stop - start) - step * new_shape:
16022  * new_shape += 1 # <<<<<<<<<<<<<<
16023  *
16024  * if new_shape < 0:
16025  */
16026  __pyx_v_new_shape = (__pyx_v_new_shape + 1);
16027 
16028  /* "View.MemoryView":872
16029  * new_shape = (stop - start) // step
16030  *
16031  * if (stop - start) - step * new_shape: # <<<<<<<<<<<<<<
16032  * new_shape += 1
16033  *
16034  */
16035  }
16036 
16037  /* "View.MemoryView":875
16038  * new_shape += 1
16039  *
16040  * if new_shape < 0: # <<<<<<<<<<<<<<
16041  * new_shape = 0
16042  *
16043  */
16044  __pyx_t_2 = ((__pyx_v_new_shape < 0) != 0);
16045  if (__pyx_t_2) {
16046 
16047  /* "View.MemoryView":876
16048  *
16049  * if new_shape < 0:
16050  * new_shape = 0 # <<<<<<<<<<<<<<
16051  *
16052  *
16053  */
16054  __pyx_v_new_shape = 0;
16055 
16056  /* "View.MemoryView":875
16057  * new_shape += 1
16058  *
16059  * if new_shape < 0: # <<<<<<<<<<<<<<
16060  * new_shape = 0
16061  *
16062  */
16063  }
16064 
16065  /* "View.MemoryView":879
16066  *
16067  *
16068  * dst.strides[new_ndim] = stride * step # <<<<<<<<<<<<<<
16069  * dst.shape[new_ndim] = new_shape
16070  * dst.suboffsets[new_ndim] = suboffset
16071  */
16072  (__pyx_v_dst->strides[__pyx_v_new_ndim]) = (__pyx_v_stride * __pyx_v_step);
16073 
16074  /* "View.MemoryView":880
16075  *
16076  * dst.strides[new_ndim] = stride * step
16077  * dst.shape[new_ndim] = new_shape # <<<<<<<<<<<<<<
16078  * dst.suboffsets[new_ndim] = suboffset
16079  *
16080  */
16081  (__pyx_v_dst->shape[__pyx_v_new_ndim]) = __pyx_v_new_shape;
16082 
16083  /* "View.MemoryView":881
16084  * dst.strides[new_ndim] = stride * step
16085  * dst.shape[new_ndim] = new_shape
16086  * dst.suboffsets[new_ndim] = suboffset # <<<<<<<<<<<<<<
16087  *
16088  *
16089  */
16090  (__pyx_v_dst->suboffsets[__pyx_v_new_ndim]) = __pyx_v_suboffset;
16091  }
16092  __pyx_L3:;
16093 
16094  /* "View.MemoryView":884
16095  *
16096  *
16097  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16098  * dst.data += start * stride
16099  * else:
16100  */
16101  __pyx_t_2 = (((__pyx_v_suboffset_dim[0]) < 0) != 0);
16102  if (__pyx_t_2) {
16103 
16104  /* "View.MemoryView":885
16105  *
16106  * if suboffset_dim[0] < 0:
16107  * dst.data += start * stride # <<<<<<<<<<<<<<
16108  * else:
16109  * dst.suboffsets[suboffset_dim[0]] += start * stride
16110  */
16111  __pyx_v_dst->data = (__pyx_v_dst->data + (__pyx_v_start * __pyx_v_stride));
16112 
16113  /* "View.MemoryView":884
16114  *
16115  *
16116  * if suboffset_dim[0] < 0: # <<<<<<<<<<<<<<
16117  * dst.data += start * stride
16118  * else:
16119  */
16120  goto __pyx_L23;
16121  }
16122 
16123  /* "View.MemoryView":887
16124  * dst.data += start * stride
16125  * else:
16126  * dst.suboffsets[suboffset_dim[0]] += start * stride # <<<<<<<<<<<<<<
16127  *
16128  * if suboffset >= 0:
16129  */
16130  /*else*/ {
16131  __pyx_t_3 = (__pyx_v_suboffset_dim[0]);
16132  (__pyx_v_dst->suboffsets[__pyx_t_3]) = ((__pyx_v_dst->suboffsets[__pyx_t_3]) + (__pyx_v_start * __pyx_v_stride));
16133  }
16134  __pyx_L23:;
16135 
16136  /* "View.MemoryView":889
16137  * dst.suboffsets[suboffset_dim[0]] += start * stride
16138  *
16139  * if suboffset >= 0: # <<<<<<<<<<<<<<
16140  * if not is_slice:
16141  * if new_ndim == 0:
16142  */
16143  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16144  if (__pyx_t_2) {
16145 
16146  /* "View.MemoryView":890
16147  *
16148  * if suboffset >= 0:
16149  * if not is_slice: # <<<<<<<<<<<<<<
16150  * if new_ndim == 0:
16151  * dst.data = (<char **> dst.data)[0] + suboffset
16152  */
16153  __pyx_t_2 = ((!(__pyx_v_is_slice != 0)) != 0);
16154  if (__pyx_t_2) {
16155 
16156  /* "View.MemoryView":891
16157  * if suboffset >= 0:
16158  * if not is_slice:
16159  * if new_ndim == 0: # <<<<<<<<<<<<<<
16160  * dst.data = (<char **> dst.data)[0] + suboffset
16161  * else:
16162  */
16163  __pyx_t_2 = ((__pyx_v_new_ndim == 0) != 0);
16164  if (__pyx_t_2) {
16165 
16166  /* "View.MemoryView":892
16167  * if not is_slice:
16168  * if new_ndim == 0:
16169  * dst.data = (<char **> dst.data)[0] + suboffset # <<<<<<<<<<<<<<
16170  * else:
16171  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16172  */
16173  __pyx_v_dst->data = ((((char **)__pyx_v_dst->data)[0]) + __pyx_v_suboffset);
16174 
16175  /* "View.MemoryView":891
16176  * if suboffset >= 0:
16177  * if not is_slice:
16178  * if new_ndim == 0: # <<<<<<<<<<<<<<
16179  * dst.data = (<char **> dst.data)[0] + suboffset
16180  * else:
16181  */
16182  goto __pyx_L26;
16183  }
16184 
16185  /* "View.MemoryView":894
16186  * dst.data = (<char **> dst.data)[0] + suboffset
16187  * else:
16188  * _err_dim(IndexError, "All dimensions preceding dimension %d " # <<<<<<<<<<<<<<
16189  * "must be indexed and not sliced", dim)
16190  * else:
16191  */
16192  /*else*/ {
16193 
16194  /* "View.MemoryView":895
16195  * else:
16196  * _err_dim(IndexError, "All dimensions preceding dimension %d "
16197  * "must be indexed and not sliced", dim) # <<<<<<<<<<<<<<
16198  * else:
16199  * suboffset_dim[0] = new_ndim
16200  */
16201  __pyx_t_3 = __pyx_memoryview_err_dim(__pyx_builtin_IndexError, ((char *)"All dimensions preceding dimension %d must be indexed and not sliced"), __pyx_v_dim); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 894, __pyx_L1_error)
16202  }
16203  __pyx_L26:;
16204 
16205  /* "View.MemoryView":890
16206  *
16207  * if suboffset >= 0:
16208  * if not is_slice: # <<<<<<<<<<<<<<
16209  * if new_ndim == 0:
16210  * dst.data = (<char **> dst.data)[0] + suboffset
16211  */
16212  goto __pyx_L25;
16213  }
16214 
16215  /* "View.MemoryView":897
16216  * "must be indexed and not sliced", dim)
16217  * else:
16218  * suboffset_dim[0] = new_ndim # <<<<<<<<<<<<<<
16219  *
16220  * return 0
16221  */
16222  /*else*/ {
16223  (__pyx_v_suboffset_dim[0]) = __pyx_v_new_ndim;
16224  }
16225  __pyx_L25:;
16226 
16227  /* "View.MemoryView":889
16228  * dst.suboffsets[suboffset_dim[0]] += start * stride
16229  *
16230  * if suboffset >= 0: # <<<<<<<<<<<<<<
16231  * if not is_slice:
16232  * if new_ndim == 0:
16233  */
16234  }
16235 
16236  /* "View.MemoryView":899
16237  * suboffset_dim[0] = new_ndim
16238  *
16239  * return 0 # <<<<<<<<<<<<<<
16240  *
16241  *
16242  */
16243  __pyx_r = 0;
16244  goto __pyx_L0;
16245 
16246  /* "View.MemoryView":802
16247  *
16248  * @cname('__pyx_memoryview_slice_memviewslice')
16249  * cdef int slice_memviewslice( # <<<<<<<<<<<<<<
16250  * __Pyx_memviewslice *dst,
16251  * Py_ssize_t shape, Py_ssize_t stride, Py_ssize_t suboffset,
16252  */
16253 
16254  /* function exit code */
16255  __pyx_L1_error:;
16256  {
16257  #ifdef WITH_THREAD
16258  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16259  #endif
16260  __Pyx_AddTraceback("View.MemoryView.slice_memviewslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16261  #ifdef WITH_THREAD
16262  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16263  #endif
16264  }
16265  __pyx_r = -1;
16266  __pyx_L0:;
16267  return __pyx_r;
16268 }
16269 
16270 /* "View.MemoryView":905
16271  *
16272  * @cname('__pyx_pybuffer_index')
16273  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16274  * Py_ssize_t dim) except NULL:
16275  * cdef Py_ssize_t shape, stride, suboffset = -1
16276  */
16277 
16278 static char *__pyx_pybuffer_index(Py_buffer *__pyx_v_view, char *__pyx_v_bufp, Py_ssize_t __pyx_v_index, Py_ssize_t __pyx_v_dim) {
16279  Py_ssize_t __pyx_v_shape;
16280  Py_ssize_t __pyx_v_stride;
16281  Py_ssize_t __pyx_v_suboffset;
16282  Py_ssize_t __pyx_v_itemsize;
16283  char *__pyx_v_resultp;
16284  char *__pyx_r;
16285  __Pyx_RefNannyDeclarations
16286  Py_ssize_t __pyx_t_1;
16287  int __pyx_t_2;
16288  PyObject *__pyx_t_3 = NULL;
16289  PyObject *__pyx_t_4 = NULL;
16290  __Pyx_RefNannySetupContext("pybuffer_index", 0);
16291 
16292  /* "View.MemoryView":907
16293  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index,
16294  * Py_ssize_t dim) except NULL:
16295  * cdef Py_ssize_t shape, stride, suboffset = -1 # <<<<<<<<<<<<<<
16296  * cdef Py_ssize_t itemsize = view.itemsize
16297  * cdef char *resultp
16298  */
16299  __pyx_v_suboffset = -1L;
16300 
16301  /* "View.MemoryView":908
16302  * Py_ssize_t dim) except NULL:
16303  * cdef Py_ssize_t shape, stride, suboffset = -1
16304  * cdef Py_ssize_t itemsize = view.itemsize # <<<<<<<<<<<<<<
16305  * cdef char *resultp
16306  *
16307  */
16308  __pyx_t_1 = __pyx_v_view->itemsize;
16309  __pyx_v_itemsize = __pyx_t_1;
16310 
16311  /* "View.MemoryView":911
16312  * cdef char *resultp
16313  *
16314  * if view.ndim == 0: # <<<<<<<<<<<<<<
16315  * shape = view.len / itemsize
16316  * stride = itemsize
16317  */
16318  __pyx_t_2 = ((__pyx_v_view->ndim == 0) != 0);
16319  if (__pyx_t_2) {
16320 
16321  /* "View.MemoryView":912
16322  *
16323  * if view.ndim == 0:
16324  * shape = view.len / itemsize # <<<<<<<<<<<<<<
16325  * stride = itemsize
16326  * else:
16327  */
16328  if (unlikely(__pyx_v_itemsize == 0)) {
16329  PyErr_SetString(PyExc_ZeroDivisionError, "integer division or modulo by zero");
16330  __PYX_ERR(0, 912, __pyx_L1_error)
16331  }
16332  else if (sizeof(Py_ssize_t) == sizeof(long) && (!(((Py_ssize_t)-1) > 0)) && unlikely(__pyx_v_itemsize == (Py_ssize_t)-1) && unlikely(UNARY_NEG_WOULD_OVERFLOW(__pyx_v_view->len))) {
16333  PyErr_SetString(PyExc_OverflowError, "value too large to perform division");
16334  __PYX_ERR(0, 912, __pyx_L1_error)
16335  }
16336  __pyx_v_shape = __Pyx_div_Py_ssize_t(__pyx_v_view->len, __pyx_v_itemsize);
16337 
16338  /* "View.MemoryView":913
16339  * if view.ndim == 0:
16340  * shape = view.len / itemsize
16341  * stride = itemsize # <<<<<<<<<<<<<<
16342  * else:
16343  * shape = view.shape[dim]
16344  */
16345  __pyx_v_stride = __pyx_v_itemsize;
16346 
16347  /* "View.MemoryView":911
16348  * cdef char *resultp
16349  *
16350  * if view.ndim == 0: # <<<<<<<<<<<<<<
16351  * shape = view.len / itemsize
16352  * stride = itemsize
16353  */
16354  goto __pyx_L3;
16355  }
16356 
16357  /* "View.MemoryView":915
16358  * stride = itemsize
16359  * else:
16360  * shape = view.shape[dim] # <<<<<<<<<<<<<<
16361  * stride = view.strides[dim]
16362  * if view.suboffsets != NULL:
16363  */
16364  /*else*/ {
16365  __pyx_v_shape = (__pyx_v_view->shape[__pyx_v_dim]);
16366 
16367  /* "View.MemoryView":916
16368  * else:
16369  * shape = view.shape[dim]
16370  * stride = view.strides[dim] # <<<<<<<<<<<<<<
16371  * if view.suboffsets != NULL:
16372  * suboffset = view.suboffsets[dim]
16373  */
16374  __pyx_v_stride = (__pyx_v_view->strides[__pyx_v_dim]);
16375 
16376  /* "View.MemoryView":917
16377  * shape = view.shape[dim]
16378  * stride = view.strides[dim]
16379  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16380  * suboffset = view.suboffsets[dim]
16381  *
16382  */
16383  __pyx_t_2 = ((__pyx_v_view->suboffsets != NULL) != 0);
16384  if (__pyx_t_2) {
16385 
16386  /* "View.MemoryView":918
16387  * stride = view.strides[dim]
16388  * if view.suboffsets != NULL:
16389  * suboffset = view.suboffsets[dim] # <<<<<<<<<<<<<<
16390  *
16391  * if index < 0:
16392  */
16393  __pyx_v_suboffset = (__pyx_v_view->suboffsets[__pyx_v_dim]);
16394 
16395  /* "View.MemoryView":917
16396  * shape = view.shape[dim]
16397  * stride = view.strides[dim]
16398  * if view.suboffsets != NULL: # <<<<<<<<<<<<<<
16399  * suboffset = view.suboffsets[dim]
16400  *
16401  */
16402  }
16403  }
16404  __pyx_L3:;
16405 
16406  /* "View.MemoryView":920
16407  * suboffset = view.suboffsets[dim]
16408  *
16409  * if index < 0: # <<<<<<<<<<<<<<
16410  * index += view.shape[dim]
16411  * if index < 0:
16412  */
16413  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16414  if (__pyx_t_2) {
16415 
16416  /* "View.MemoryView":921
16417  *
16418  * if index < 0:
16419  * index += view.shape[dim] # <<<<<<<<<<<<<<
16420  * if index < 0:
16421  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16422  */
16423  __pyx_v_index = (__pyx_v_index + (__pyx_v_view->shape[__pyx_v_dim]));
16424 
16425  /* "View.MemoryView":922
16426  * if index < 0:
16427  * index += view.shape[dim]
16428  * if index < 0: # <<<<<<<<<<<<<<
16429  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16430  *
16431  */
16432  __pyx_t_2 = ((__pyx_v_index < 0) != 0);
16433  if (unlikely(__pyx_t_2)) {
16434 
16435  /* "View.MemoryView":923
16436  * index += view.shape[dim]
16437  * if index < 0:
16438  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16439  *
16440  * if index >= shape:
16441  */
16442  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
16443  __Pyx_GOTREF(__pyx_t_3);
16444  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 923, __pyx_L1_error)
16445  __Pyx_GOTREF(__pyx_t_4);
16446  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16447  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 923, __pyx_L1_error)
16448  __Pyx_GOTREF(__pyx_t_3);
16449  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16450  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16451  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16452  __PYX_ERR(0, 923, __pyx_L1_error)
16453 
16454  /* "View.MemoryView":922
16455  * if index < 0:
16456  * index += view.shape[dim]
16457  * if index < 0: # <<<<<<<<<<<<<<
16458  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16459  *
16460  */
16461  }
16462 
16463  /* "View.MemoryView":920
16464  * suboffset = view.suboffsets[dim]
16465  *
16466  * if index < 0: # <<<<<<<<<<<<<<
16467  * index += view.shape[dim]
16468  * if index < 0:
16469  */
16470  }
16471 
16472  /* "View.MemoryView":925
16473  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16474  *
16475  * if index >= shape: # <<<<<<<<<<<<<<
16476  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16477  *
16478  */
16479  __pyx_t_2 = ((__pyx_v_index >= __pyx_v_shape) != 0);
16480  if (unlikely(__pyx_t_2)) {
16481 
16482  /* "View.MemoryView":926
16483  *
16484  * if index >= shape:
16485  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim) # <<<<<<<<<<<<<<
16486  *
16487  * resultp = bufp + index * stride
16488  */
16489  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error)
16490  __Pyx_GOTREF(__pyx_t_3);
16491  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 926, __pyx_L1_error)
16492  __Pyx_GOTREF(__pyx_t_4);
16493  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16494  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_builtin_IndexError, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 926, __pyx_L1_error)
16495  __Pyx_GOTREF(__pyx_t_3);
16496  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
16497  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
16498  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16499  __PYX_ERR(0, 926, __pyx_L1_error)
16500 
16501  /* "View.MemoryView":925
16502  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16503  *
16504  * if index >= shape: # <<<<<<<<<<<<<<
16505  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16506  *
16507  */
16508  }
16509 
16510  /* "View.MemoryView":928
16511  * raise IndexError("Out of bounds on buffer access (axis %d)" % dim)
16512  *
16513  * resultp = bufp + index * stride # <<<<<<<<<<<<<<
16514  * if suboffset >= 0:
16515  * resultp = (<char **> resultp)[0] + suboffset
16516  */
16517  __pyx_v_resultp = (__pyx_v_bufp + (__pyx_v_index * __pyx_v_stride));
16518 
16519  /* "View.MemoryView":929
16520  *
16521  * resultp = bufp + index * stride
16522  * if suboffset >= 0: # <<<<<<<<<<<<<<
16523  * resultp = (<char **> resultp)[0] + suboffset
16524  *
16525  */
16526  __pyx_t_2 = ((__pyx_v_suboffset >= 0) != 0);
16527  if (__pyx_t_2) {
16528 
16529  /* "View.MemoryView":930
16530  * resultp = bufp + index * stride
16531  * if suboffset >= 0:
16532  * resultp = (<char **> resultp)[0] + suboffset # <<<<<<<<<<<<<<
16533  *
16534  * return resultp
16535  */
16536  __pyx_v_resultp = ((((char **)__pyx_v_resultp)[0]) + __pyx_v_suboffset);
16537 
16538  /* "View.MemoryView":929
16539  *
16540  * resultp = bufp + index * stride
16541  * if suboffset >= 0: # <<<<<<<<<<<<<<
16542  * resultp = (<char **> resultp)[0] + suboffset
16543  *
16544  */
16545  }
16546 
16547  /* "View.MemoryView":932
16548  * resultp = (<char **> resultp)[0] + suboffset
16549  *
16550  * return resultp # <<<<<<<<<<<<<<
16551  *
16552  *
16553  */
16554  __pyx_r = __pyx_v_resultp;
16555  goto __pyx_L0;
16556 
16557  /* "View.MemoryView":905
16558  *
16559  * @cname('__pyx_pybuffer_index')
16560  * cdef char *pybuffer_index(Py_buffer *view, char *bufp, Py_ssize_t index, # <<<<<<<<<<<<<<
16561  * Py_ssize_t dim) except NULL:
16562  * cdef Py_ssize_t shape, stride, suboffset = -1
16563  */
16564 
16565  /* function exit code */
16566  __pyx_L1_error:;
16567  __Pyx_XDECREF(__pyx_t_3);
16568  __Pyx_XDECREF(__pyx_t_4);
16569  __Pyx_AddTraceback("View.MemoryView.pybuffer_index", __pyx_clineno, __pyx_lineno, __pyx_filename);
16570  __pyx_r = NULL;
16571  __pyx_L0:;
16572  __Pyx_RefNannyFinishContext();
16573  return __pyx_r;
16574 }
16575 
16576 /* "View.MemoryView":938
16577  *
16578  * @cname('__pyx_memslice_transpose')
16579  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16580  * cdef int ndim = memslice.memview.view.ndim
16581  *
16582  */
16583 
16584 static int __pyx_memslice_transpose(__Pyx_memviewslice *__pyx_v_memslice) {
16585  int __pyx_v_ndim;
16586  Py_ssize_t *__pyx_v_shape;
16587  Py_ssize_t *__pyx_v_strides;
16588  int __pyx_v_i;
16589  int __pyx_v_j;
16590  int __pyx_r;
16591  int __pyx_t_1;
16592  Py_ssize_t *__pyx_t_2;
16593  long __pyx_t_3;
16594  long __pyx_t_4;
16595  Py_ssize_t __pyx_t_5;
16596  Py_ssize_t __pyx_t_6;
16597  int __pyx_t_7;
16598  int __pyx_t_8;
16599  int __pyx_t_9;
16600 
16601  /* "View.MemoryView":939
16602  * @cname('__pyx_memslice_transpose')
16603  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0:
16604  * cdef int ndim = memslice.memview.view.ndim # <<<<<<<<<<<<<<
16605  *
16606  * cdef Py_ssize_t *shape = memslice.shape
16607  */
16608  __pyx_t_1 = __pyx_v_memslice->memview->view.ndim;
16609  __pyx_v_ndim = __pyx_t_1;
16610 
16611  /* "View.MemoryView":941
16612  * cdef int ndim = memslice.memview.view.ndim
16613  *
16614  * cdef Py_ssize_t *shape = memslice.shape # <<<<<<<<<<<<<<
16615  * cdef Py_ssize_t *strides = memslice.strides
16616  *
16617  */
16618  __pyx_t_2 = __pyx_v_memslice->shape;
16619  __pyx_v_shape = __pyx_t_2;
16620 
16621  /* "View.MemoryView":942
16622  *
16623  * cdef Py_ssize_t *shape = memslice.shape
16624  * cdef Py_ssize_t *strides = memslice.strides # <<<<<<<<<<<<<<
16625  *
16626  *
16627  */
16628  __pyx_t_2 = __pyx_v_memslice->strides;
16629  __pyx_v_strides = __pyx_t_2;
16630 
16631  /* "View.MemoryView":946
16632  *
16633  * cdef int i, j
16634  * for i in range(ndim / 2): # <<<<<<<<<<<<<<
16635  * j = ndim - 1 - i
16636  * strides[i], strides[j] = strides[j], strides[i]
16637  */
16638  __pyx_t_3 = __Pyx_div_long(__pyx_v_ndim, 2);
16639  __pyx_t_4 = __pyx_t_3;
16640  for (__pyx_t_1 = 0; __pyx_t_1 < __pyx_t_4; __pyx_t_1+=1) {
16641  __pyx_v_i = __pyx_t_1;
16642 
16643  /* "View.MemoryView":947
16644  * cdef int i, j
16645  * for i in range(ndim / 2):
16646  * j = ndim - 1 - i # <<<<<<<<<<<<<<
16647  * strides[i], strides[j] = strides[j], strides[i]
16648  * shape[i], shape[j] = shape[j], shape[i]
16649  */
16650  __pyx_v_j = ((__pyx_v_ndim - 1) - __pyx_v_i);
16651 
16652  /* "View.MemoryView":948
16653  * for i in range(ndim / 2):
16654  * j = ndim - 1 - i
16655  * strides[i], strides[j] = strides[j], strides[i] # <<<<<<<<<<<<<<
16656  * shape[i], shape[j] = shape[j], shape[i]
16657  *
16658  */
16659  __pyx_t_5 = (__pyx_v_strides[__pyx_v_j]);
16660  __pyx_t_6 = (__pyx_v_strides[__pyx_v_i]);
16661  (__pyx_v_strides[__pyx_v_i]) = __pyx_t_5;
16662  (__pyx_v_strides[__pyx_v_j]) = __pyx_t_6;
16663 
16664  /* "View.MemoryView":949
16665  * j = ndim - 1 - i
16666  * strides[i], strides[j] = strides[j], strides[i]
16667  * shape[i], shape[j] = shape[j], shape[i] # <<<<<<<<<<<<<<
16668  *
16669  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16670  */
16671  __pyx_t_6 = (__pyx_v_shape[__pyx_v_j]);
16672  __pyx_t_5 = (__pyx_v_shape[__pyx_v_i]);
16673  (__pyx_v_shape[__pyx_v_i]) = __pyx_t_6;
16674  (__pyx_v_shape[__pyx_v_j]) = __pyx_t_5;
16675 
16676  /* "View.MemoryView":951
16677  * shape[i], shape[j] = shape[j], shape[i]
16678  *
16679  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16680  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16681  *
16682  */
16683  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_i]) >= 0) != 0);
16684  if (!__pyx_t_8) {
16685  } else {
16686  __pyx_t_7 = __pyx_t_8;
16687  goto __pyx_L6_bool_binop_done;
16688  }
16689  __pyx_t_8 = (((__pyx_v_memslice->suboffsets[__pyx_v_j]) >= 0) != 0);
16690  __pyx_t_7 = __pyx_t_8;
16691  __pyx_L6_bool_binop_done:;
16692  if (__pyx_t_7) {
16693 
16694  /* "View.MemoryView":952
16695  *
16696  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0:
16697  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions") # <<<<<<<<<<<<<<
16698  *
16699  * return 1
16700  */
16701  __pyx_t_9 = __pyx_memoryview_err(__pyx_builtin_ValueError, ((char *)"Cannot transpose memoryview with indirect dimensions")); if (unlikely(__pyx_t_9 == ((int)-1))) __PYX_ERR(0, 952, __pyx_L1_error)
16702 
16703  /* "View.MemoryView":951
16704  * shape[i], shape[j] = shape[j], shape[i]
16705  *
16706  * if memslice.suboffsets[i] >= 0 or memslice.suboffsets[j] >= 0: # <<<<<<<<<<<<<<
16707  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16708  *
16709  */
16710  }
16711  }
16712 
16713  /* "View.MemoryView":954
16714  * _err(ValueError, "Cannot transpose memoryview with indirect dimensions")
16715  *
16716  * return 1 # <<<<<<<<<<<<<<
16717  *
16718  *
16719  */
16720  __pyx_r = 1;
16721  goto __pyx_L0;
16722 
16723  /* "View.MemoryView":938
16724  *
16725  * @cname('__pyx_memslice_transpose')
16726  * cdef int transpose_memslice(__Pyx_memviewslice *memslice) nogil except 0: # <<<<<<<<<<<<<<
16727  * cdef int ndim = memslice.memview.view.ndim
16728  *
16729  */
16730 
16731  /* function exit code */
16732  __pyx_L1_error:;
16733  {
16734  #ifdef WITH_THREAD
16735  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
16736  #endif
16737  __Pyx_AddTraceback("View.MemoryView.transpose_memslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
16738  #ifdef WITH_THREAD
16739  __Pyx_PyGILState_Release(__pyx_gilstate_save);
16740  #endif
16741  }
16742  __pyx_r = 0;
16743  __pyx_L0:;
16744  return __pyx_r;
16745 }
16746 
16747 /* "View.MemoryView":971
16748  * cdef int (*to_dtype_func)(char *, object) except 0
16749  *
16750  * def __dealloc__(self): # <<<<<<<<<<<<<<
16751  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16752  *
16753  */
16754 
16755 /* Python wrapper */
16756 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self); /*proto*/
16757 static void __pyx_memoryviewslice___dealloc__(PyObject *__pyx_v_self) {
16758  __Pyx_RefNannyDeclarations
16759  __Pyx_RefNannySetupContext("__dealloc__ (wrapper)", 0);
16760  __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16761 
16762  /* function exit code */
16763  __Pyx_RefNannyFinishContext();
16764 }
16765 
16766 static void __pyx_memoryviewslice___pyx_pf_15View_dot_MemoryView_16_memoryviewslice___dealloc__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16767  __Pyx_RefNannyDeclarations
16768  __Pyx_RefNannySetupContext("__dealloc__", 0);
16769 
16770  /* "View.MemoryView":972
16771  *
16772  * def __dealloc__(self):
16773  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1) # <<<<<<<<<<<<<<
16774  *
16775  * cdef convert_item_to_object(self, char *itemp):
16776  */
16777  __PYX_XDEC_MEMVIEW((&__pyx_v_self->from_slice), 1);
16778 
16779  /* "View.MemoryView":971
16780  * cdef int (*to_dtype_func)(char *, object) except 0
16781  *
16782  * def __dealloc__(self): # <<<<<<<<<<<<<<
16783  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16784  *
16785  */
16786 
16787  /* function exit code */
16788  __Pyx_RefNannyFinishContext();
16789 }
16790 
16791 /* "View.MemoryView":974
16792  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16793  *
16794  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16795  * if self.to_object_func != NULL:
16796  * return self.to_object_func(itemp)
16797  */
16798 
16799 static PyObject *__pyx_memoryviewslice_convert_item_to_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp) {
16800  PyObject *__pyx_r = NULL;
16801  __Pyx_RefNannyDeclarations
16802  int __pyx_t_1;
16803  PyObject *__pyx_t_2 = NULL;
16804  __Pyx_RefNannySetupContext("convert_item_to_object", 0);
16805 
16806  /* "View.MemoryView":975
16807  *
16808  * cdef convert_item_to_object(self, char *itemp):
16809  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16810  * return self.to_object_func(itemp)
16811  * else:
16812  */
16813  __pyx_t_1 = ((__pyx_v_self->to_object_func != NULL) != 0);
16814  if (__pyx_t_1) {
16815 
16816  /* "View.MemoryView":976
16817  * cdef convert_item_to_object(self, char *itemp):
16818  * if self.to_object_func != NULL:
16819  * return self.to_object_func(itemp) # <<<<<<<<<<<<<<
16820  * else:
16821  * return memoryview.convert_item_to_object(self, itemp)
16822  */
16823  __Pyx_XDECREF(__pyx_r);
16824  __pyx_t_2 = __pyx_v_self->to_object_func(__pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 976, __pyx_L1_error)
16825  __Pyx_GOTREF(__pyx_t_2);
16826  __pyx_r = __pyx_t_2;
16827  __pyx_t_2 = 0;
16828  goto __pyx_L0;
16829 
16830  /* "View.MemoryView":975
16831  *
16832  * cdef convert_item_to_object(self, char *itemp):
16833  * if self.to_object_func != NULL: # <<<<<<<<<<<<<<
16834  * return self.to_object_func(itemp)
16835  * else:
16836  */
16837  }
16838 
16839  /* "View.MemoryView":978
16840  * return self.to_object_func(itemp)
16841  * else:
16842  * return memoryview.convert_item_to_object(self, itemp) # <<<<<<<<<<<<<<
16843  *
16844  * cdef assign_item_from_object(self, char *itemp, object value):
16845  */
16846  /*else*/ {
16847  __Pyx_XDECREF(__pyx_r);
16848  __pyx_t_2 = __pyx_memoryview_convert_item_to_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 978, __pyx_L1_error)
16849  __Pyx_GOTREF(__pyx_t_2);
16850  __pyx_r = __pyx_t_2;
16851  __pyx_t_2 = 0;
16852  goto __pyx_L0;
16853  }
16854 
16855  /* "View.MemoryView":974
16856  * __PYX_XDEC_MEMVIEW(&self.from_slice, 1)
16857  *
16858  * cdef convert_item_to_object(self, char *itemp): # <<<<<<<<<<<<<<
16859  * if self.to_object_func != NULL:
16860  * return self.to_object_func(itemp)
16861  */
16862 
16863  /* function exit code */
16864  __pyx_L1_error:;
16865  __Pyx_XDECREF(__pyx_t_2);
16866  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.convert_item_to_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16867  __pyx_r = 0;
16868  __pyx_L0:;
16869  __Pyx_XGIVEREF(__pyx_r);
16870  __Pyx_RefNannyFinishContext();
16871  return __pyx_r;
16872 }
16873 
16874 /* "View.MemoryView":980
16875  * return memoryview.convert_item_to_object(self, itemp)
16876  *
16877  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16878  * if self.to_dtype_func != NULL:
16879  * self.to_dtype_func(itemp, value)
16880  */
16881 
16882 static PyObject *__pyx_memoryviewslice_assign_item_from_object(struct __pyx_memoryviewslice_obj *__pyx_v_self, char *__pyx_v_itemp, PyObject *__pyx_v_value) {
16883  PyObject *__pyx_r = NULL;
16884  __Pyx_RefNannyDeclarations
16885  int __pyx_t_1;
16886  int __pyx_t_2;
16887  PyObject *__pyx_t_3 = NULL;
16888  __Pyx_RefNannySetupContext("assign_item_from_object", 0);
16889 
16890  /* "View.MemoryView":981
16891  *
16892  * cdef assign_item_from_object(self, char *itemp, object value):
16893  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16894  * self.to_dtype_func(itemp, value)
16895  * else:
16896  */
16897  __pyx_t_1 = ((__pyx_v_self->to_dtype_func != NULL) != 0);
16898  if (__pyx_t_1) {
16899 
16900  /* "View.MemoryView":982
16901  * cdef assign_item_from_object(self, char *itemp, object value):
16902  * if self.to_dtype_func != NULL:
16903  * self.to_dtype_func(itemp, value) # <<<<<<<<<<<<<<
16904  * else:
16905  * memoryview.assign_item_from_object(self, itemp, value)
16906  */
16907  __pyx_t_2 = __pyx_v_self->to_dtype_func(__pyx_v_itemp, __pyx_v_value); if (unlikely(__pyx_t_2 == ((int)0))) __PYX_ERR(0, 982, __pyx_L1_error)
16908 
16909  /* "View.MemoryView":981
16910  *
16911  * cdef assign_item_from_object(self, char *itemp, object value):
16912  * if self.to_dtype_func != NULL: # <<<<<<<<<<<<<<
16913  * self.to_dtype_func(itemp, value)
16914  * else:
16915  */
16916  goto __pyx_L3;
16917  }
16918 
16919  /* "View.MemoryView":984
16920  * self.to_dtype_func(itemp, value)
16921  * else:
16922  * memoryview.assign_item_from_object(self, itemp, value) # <<<<<<<<<<<<<<
16923  *
16924  * @property
16925  */
16926  /*else*/ {
16927  __pyx_t_3 = __pyx_memoryview_assign_item_from_object(((struct __pyx_memoryview_obj *)__pyx_v_self), __pyx_v_itemp, __pyx_v_value); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 984, __pyx_L1_error)
16928  __Pyx_GOTREF(__pyx_t_3);
16929  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
16930  }
16931  __pyx_L3:;
16932 
16933  /* "View.MemoryView":980
16934  * return memoryview.convert_item_to_object(self, itemp)
16935  *
16936  * cdef assign_item_from_object(self, char *itemp, object value): # <<<<<<<<<<<<<<
16937  * if self.to_dtype_func != NULL:
16938  * self.to_dtype_func(itemp, value)
16939  */
16940 
16941  /* function exit code */
16942  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
16943  goto __pyx_L0;
16944  __pyx_L1_error:;
16945  __Pyx_XDECREF(__pyx_t_3);
16946  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.assign_item_from_object", __pyx_clineno, __pyx_lineno, __pyx_filename);
16947  __pyx_r = 0;
16948  __pyx_L0:;
16949  __Pyx_XGIVEREF(__pyx_r);
16950  __Pyx_RefNannyFinishContext();
16951  return __pyx_r;
16952 }
16953 
16954 /* "View.MemoryView":987
16955  *
16956  * @property
16957  * def base(self): # <<<<<<<<<<<<<<
16958  * return self.from_object
16959  *
16960  */
16961 
16962 /* Python wrapper */
16963 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self); /*proto*/
16964 static PyObject *__pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(PyObject *__pyx_v_self) {
16965  PyObject *__pyx_r = 0;
16966  __Pyx_RefNannyDeclarations
16967  __Pyx_RefNannySetupContext("__get__ (wrapper)", 0);
16968  __pyx_r = __pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
16969 
16970  /* function exit code */
16971  __Pyx_RefNannyFinishContext();
16972  return __pyx_r;
16973 }
16974 
16975 static PyObject *__pyx_pf_15View_dot_MemoryView_16_memoryviewslice_4base___get__(struct __pyx_memoryviewslice_obj *__pyx_v_self) {
16976  PyObject *__pyx_r = NULL;
16977  __Pyx_RefNannyDeclarations
16978  __Pyx_RefNannySetupContext("__get__", 0);
16979 
16980  /* "View.MemoryView":988
16981  * @property
16982  * def base(self):
16983  * return self.from_object # <<<<<<<<<<<<<<
16984  *
16985  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)")
16986  */
16987  __Pyx_XDECREF(__pyx_r);
16988  __Pyx_INCREF(__pyx_v_self->from_object);
16989  __pyx_r = __pyx_v_self->from_object;
16990  goto __pyx_L0;
16991 
16992  /* "View.MemoryView":987
16993  *
16994  * @property
16995  * def base(self): # <<<<<<<<<<<<<<
16996  * return self.from_object
16997  *
16998  */
16999 
17000  /* function exit code */
17001  __pyx_L0:;
17002  __Pyx_XGIVEREF(__pyx_r);
17003  __Pyx_RefNannyFinishContext();
17004  return __pyx_r;
17005 }
17006 
17007 /* "(tree fragment)":1
17008  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17009  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17010  * def __setstate_cython__(self, __pyx_state):
17011  */
17012 
17013 /* Python wrapper */
17014 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused); /*proto*/
17015 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_1__reduce_cython__ = {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0};
17016 static PyObject *__pyx_pw___pyx_memoryviewslice_1__reduce_cython__(PyObject *__pyx_v_self, CYTHON_UNUSED PyObject *unused) {
17017  PyObject *__pyx_r = 0;
17018  __Pyx_RefNannyDeclarations
17019  __Pyx_RefNannySetupContext("__reduce_cython__ (wrapper)", 0);
17020  __pyx_r = __pyx_pf___pyx_memoryviewslice___reduce_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self));
17021 
17022  /* function exit code */
17023  __Pyx_RefNannyFinishContext();
17024  return __pyx_r;
17025 }
17026 
17027 static PyObject *__pyx_pf___pyx_memoryviewslice___reduce_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self) {
17028  PyObject *__pyx_r = NULL;
17029  __Pyx_RefNannyDeclarations
17030  PyObject *__pyx_t_1 = NULL;
17031  __Pyx_RefNannySetupContext("__reduce_cython__", 0);
17032 
17033  /* "(tree fragment)":2
17034  * def __reduce_cython__(self):
17035  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17036  * def __setstate_cython__(self, __pyx_state):
17037  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17038  */
17039  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__31, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 2, __pyx_L1_error)
17040  __Pyx_GOTREF(__pyx_t_1);
17041  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17042  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17043  __PYX_ERR(0, 2, __pyx_L1_error)
17044 
17045  /* "(tree fragment)":1
17046  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
17047  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17048  * def __setstate_cython__(self, __pyx_state):
17049  */
17050 
17051  /* function exit code */
17052  __pyx_L1_error:;
17053  __Pyx_XDECREF(__pyx_t_1);
17054  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__reduce_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17055  __pyx_r = NULL;
17056  __Pyx_XGIVEREF(__pyx_r);
17057  __Pyx_RefNannyFinishContext();
17058  return __pyx_r;
17059 }
17060 
17061 /* "(tree fragment)":3
17062  * def __reduce_cython__(self):
17063  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17064  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17065  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17066  */
17067 
17068 /* Python wrapper */
17069 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state); /*proto*/
17070 static PyMethodDef __pyx_mdef___pyx_memoryviewslice_3__setstate_cython__ = {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0};
17071 static PyObject *__pyx_pw___pyx_memoryviewslice_3__setstate_cython__(PyObject *__pyx_v_self, PyObject *__pyx_v___pyx_state) {
17072  PyObject *__pyx_r = 0;
17073  __Pyx_RefNannyDeclarations
17074  __Pyx_RefNannySetupContext("__setstate_cython__ (wrapper)", 0);
17075  __pyx_r = __pyx_pf___pyx_memoryviewslice_2__setstate_cython__(((struct __pyx_memoryviewslice_obj *)__pyx_v_self), ((PyObject *)__pyx_v___pyx_state));
17076 
17077  /* function exit code */
17078  __Pyx_RefNannyFinishContext();
17079  return __pyx_r;
17080 }
17081 
17082 static PyObject *__pyx_pf___pyx_memoryviewslice_2__setstate_cython__(CYTHON_UNUSED struct __pyx_memoryviewslice_obj *__pyx_v_self, CYTHON_UNUSED PyObject *__pyx_v___pyx_state) {
17083  PyObject *__pyx_r = NULL;
17084  __Pyx_RefNannyDeclarations
17085  PyObject *__pyx_t_1 = NULL;
17086  __Pyx_RefNannySetupContext("__setstate_cython__", 0);
17087 
17088  /* "(tree fragment)":4
17089  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17090  * def __setstate_cython__(self, __pyx_state):
17091  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
17092  */
17093  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_builtin_TypeError, __pyx_tuple__32, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 4, __pyx_L1_error)
17094  __Pyx_GOTREF(__pyx_t_1);
17095  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
17096  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
17097  __PYX_ERR(0, 4, __pyx_L1_error)
17098 
17099  /* "(tree fragment)":3
17100  * def __reduce_cython__(self):
17101  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17102  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
17103  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
17104  */
17105 
17106  /* function exit code */
17107  __pyx_L1_error:;
17108  __Pyx_XDECREF(__pyx_t_1);
17109  __Pyx_AddTraceback("View.MemoryView._memoryviewslice.__setstate_cython__", __pyx_clineno, __pyx_lineno, __pyx_filename);
17110  __pyx_r = NULL;
17111  __Pyx_XGIVEREF(__pyx_r);
17112  __Pyx_RefNannyFinishContext();
17113  return __pyx_r;
17114 }
17115 
17116 /* "View.MemoryView":994
17117  *
17118  * @cname('__pyx_memoryview_fromslice')
17119  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17120  * int ndim,
17121  * object (*to_object_func)(char *),
17122  */
17123 
17124 static PyObject *__pyx_memoryview_fromslice(__Pyx_memviewslice __pyx_v_memviewslice, int __pyx_v_ndim, PyObject *(*__pyx_v_to_object_func)(char *), int (*__pyx_v_to_dtype_func)(char *, PyObject *), int __pyx_v_dtype_is_object) {
17125  struct __pyx_memoryviewslice_obj *__pyx_v_result = 0;
17126  Py_ssize_t __pyx_v_suboffset;
17127  PyObject *__pyx_v_length = NULL;
17128  PyObject *__pyx_r = NULL;
17129  __Pyx_RefNannyDeclarations
17130  int __pyx_t_1;
17131  PyObject *__pyx_t_2 = NULL;
17132  PyObject *__pyx_t_3 = NULL;
17133  __Pyx_TypeInfo *__pyx_t_4;
17134  Py_buffer __pyx_t_5;
17135  Py_ssize_t *__pyx_t_6;
17136  Py_ssize_t *__pyx_t_7;
17137  Py_ssize_t *__pyx_t_8;
17138  Py_ssize_t __pyx_t_9;
17139  __Pyx_RefNannySetupContext("memoryview_fromslice", 0);
17140 
17141  /* "View.MemoryView":1002
17142  * cdef _memoryviewslice result
17143  *
17144  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17145  * return None
17146  *
17147  */
17148  __pyx_t_1 = ((((PyObject *)__pyx_v_memviewslice.memview) == Py_None) != 0);
17149  if (__pyx_t_1) {
17150 
17151  /* "View.MemoryView":1003
17152  *
17153  * if <PyObject *> memviewslice.memview == Py_None:
17154  * return None # <<<<<<<<<<<<<<
17155  *
17156  *
17157  */
17158  __Pyx_XDECREF(__pyx_r);
17159  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
17160  goto __pyx_L0;
17161 
17162  /* "View.MemoryView":1002
17163  * cdef _memoryviewslice result
17164  *
17165  * if <PyObject *> memviewslice.memview == Py_None: # <<<<<<<<<<<<<<
17166  * return None
17167  *
17168  */
17169  }
17170 
17171  /* "View.MemoryView":1008
17172  *
17173  *
17174  * result = _memoryviewslice(None, 0, dtype_is_object) # <<<<<<<<<<<<<<
17175  *
17176  * result.from_slice = memviewslice
17177  */
17178  __pyx_t_2 = __Pyx_PyBool_FromLong(__pyx_v_dtype_is_object); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
17179  __Pyx_GOTREF(__pyx_t_2);
17180  __pyx_t_3 = PyTuple_New(3); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1008, __pyx_L1_error)
17181  __Pyx_GOTREF(__pyx_t_3);
17182  __Pyx_INCREF(Py_None);
17183  __Pyx_GIVEREF(Py_None);
17184  PyTuple_SET_ITEM(__pyx_t_3, 0, Py_None);
17185  __Pyx_INCREF(__pyx_int_0);
17186  __Pyx_GIVEREF(__pyx_int_0);
17187  PyTuple_SET_ITEM(__pyx_t_3, 1, __pyx_int_0);
17188  __Pyx_GIVEREF(__pyx_t_2);
17189  PyTuple_SET_ITEM(__pyx_t_3, 2, __pyx_t_2);
17190  __pyx_t_2 = 0;
17191  __pyx_t_2 = __Pyx_PyObject_Call(((PyObject *)__pyx_memoryviewslice_type), __pyx_t_3, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1008, __pyx_L1_error)
17192  __Pyx_GOTREF(__pyx_t_2);
17193  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17194  __pyx_v_result = ((struct __pyx_memoryviewslice_obj *)__pyx_t_2);
17195  __pyx_t_2 = 0;
17196 
17197  /* "View.MemoryView":1010
17198  * result = _memoryviewslice(None, 0, dtype_is_object)
17199  *
17200  * result.from_slice = memviewslice # <<<<<<<<<<<<<<
17201  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17202  *
17203  */
17204  __pyx_v_result->from_slice = __pyx_v_memviewslice;
17205 
17206  /* "View.MemoryView":1011
17207  *
17208  * result.from_slice = memviewslice
17209  * __PYX_INC_MEMVIEW(&memviewslice, 1) # <<<<<<<<<<<<<<
17210  *
17211  * result.from_object = (<memoryview> memviewslice.memview).base
17212  */
17213  __PYX_INC_MEMVIEW((&__pyx_v_memviewslice), 1);
17214 
17215  /* "View.MemoryView":1013
17216  * __PYX_INC_MEMVIEW(&memviewslice, 1)
17217  *
17218  * result.from_object = (<memoryview> memviewslice.memview).base # <<<<<<<<<<<<<<
17219  * result.typeinfo = memviewslice.memview.typeinfo
17220  *
17221  */
17222  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v_memviewslice.memview), __pyx_n_s_base); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1013, __pyx_L1_error)
17223  __Pyx_GOTREF(__pyx_t_2);
17224  __Pyx_GIVEREF(__pyx_t_2);
17225  __Pyx_GOTREF(__pyx_v_result->from_object);
17226  __Pyx_DECREF(__pyx_v_result->from_object);
17227  __pyx_v_result->from_object = __pyx_t_2;
17228  __pyx_t_2 = 0;
17229 
17230  /* "View.MemoryView":1014
17231  *
17232  * result.from_object = (<memoryview> memviewslice.memview).base
17233  * result.typeinfo = memviewslice.memview.typeinfo # <<<<<<<<<<<<<<
17234  *
17235  * result.view = memviewslice.memview.view
17236  */
17237  __pyx_t_4 = __pyx_v_memviewslice.memview->typeinfo;
17238  __pyx_v_result->__pyx_base.typeinfo = __pyx_t_4;
17239 
17240  /* "View.MemoryView":1016
17241  * result.typeinfo = memviewslice.memview.typeinfo
17242  *
17243  * result.view = memviewslice.memview.view # <<<<<<<<<<<<<<
17244  * result.view.buf = <void *> memviewslice.data
17245  * result.view.ndim = ndim
17246  */
17247  __pyx_t_5 = __pyx_v_memviewslice.memview->view;
17248  __pyx_v_result->__pyx_base.view = __pyx_t_5;
17249 
17250  /* "View.MemoryView":1017
17251  *
17252  * result.view = memviewslice.memview.view
17253  * result.view.buf = <void *> memviewslice.data # <<<<<<<<<<<<<<
17254  * result.view.ndim = ndim
17255  * (<__pyx_buffer *> &result.view).obj = Py_None
17256  */
17257  __pyx_v_result->__pyx_base.view.buf = ((void *)__pyx_v_memviewslice.data);
17258 
17259  /* "View.MemoryView":1018
17260  * result.view = memviewslice.memview.view
17261  * result.view.buf = <void *> memviewslice.data
17262  * result.view.ndim = ndim # <<<<<<<<<<<<<<
17263  * (<__pyx_buffer *> &result.view).obj = Py_None
17264  * Py_INCREF(Py_None)
17265  */
17266  __pyx_v_result->__pyx_base.view.ndim = __pyx_v_ndim;
17267 
17268  /* "View.MemoryView":1019
17269  * result.view.buf = <void *> memviewslice.data
17270  * result.view.ndim = ndim
17271  * (<__pyx_buffer *> &result.view).obj = Py_None # <<<<<<<<<<<<<<
17272  * Py_INCREF(Py_None)
17273  *
17274  */
17275  ((Py_buffer *)(&__pyx_v_result->__pyx_base.view))->obj = Py_None;
17276 
17277  /* "View.MemoryView":1020
17278  * result.view.ndim = ndim
17279  * (<__pyx_buffer *> &result.view).obj = Py_None
17280  * Py_INCREF(Py_None) # <<<<<<<<<<<<<<
17281  *
17282  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17283  */
17284  Py_INCREF(Py_None);
17285 
17286  /* "View.MemoryView":1022
17287  * Py_INCREF(Py_None)
17288  *
17289  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17290  * result.flags = PyBUF_RECORDS
17291  * else:
17292  */
17293  __pyx_t_1 = ((((struct __pyx_memoryview_obj *)__pyx_v_memviewslice.memview)->flags & PyBUF_WRITABLE) != 0);
17294  if (__pyx_t_1) {
17295 
17296  /* "View.MemoryView":1023
17297  *
17298  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE:
17299  * result.flags = PyBUF_RECORDS # <<<<<<<<<<<<<<
17300  * else:
17301  * result.flags = PyBUF_RECORDS_RO
17302  */
17303  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS;
17304 
17305  /* "View.MemoryView":1022
17306  * Py_INCREF(Py_None)
17307  *
17308  * if (<memoryview>memviewslice.memview).flags & PyBUF_WRITABLE: # <<<<<<<<<<<<<<
17309  * result.flags = PyBUF_RECORDS
17310  * else:
17311  */
17312  goto __pyx_L4;
17313  }
17314 
17315  /* "View.MemoryView":1025
17316  * result.flags = PyBUF_RECORDS
17317  * else:
17318  * result.flags = PyBUF_RECORDS_RO # <<<<<<<<<<<<<<
17319  *
17320  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17321  */
17322  /*else*/ {
17323  __pyx_v_result->__pyx_base.flags = PyBUF_RECORDS_RO;
17324  }
17325  __pyx_L4:;
17326 
17327  /* "View.MemoryView":1027
17328  * result.flags = PyBUF_RECORDS_RO
17329  *
17330  * result.view.shape = <Py_ssize_t *> result.from_slice.shape # <<<<<<<<<<<<<<
17331  * result.view.strides = <Py_ssize_t *> result.from_slice.strides
17332  *
17333  */
17334  __pyx_v_result->__pyx_base.view.shape = ((Py_ssize_t *)__pyx_v_result->from_slice.shape);
17335 
17336  /* "View.MemoryView":1028
17337  *
17338  * result.view.shape = <Py_ssize_t *> result.from_slice.shape
17339  * result.view.strides = <Py_ssize_t *> result.from_slice.strides # <<<<<<<<<<<<<<
17340  *
17341  *
17342  */
17343  __pyx_v_result->__pyx_base.view.strides = ((Py_ssize_t *)__pyx_v_result->from_slice.strides);
17344 
17345  /* "View.MemoryView":1031
17346  *
17347  *
17348  * result.view.suboffsets = NULL # <<<<<<<<<<<<<<
17349  * for suboffset in result.from_slice.suboffsets[:ndim]:
17350  * if suboffset >= 0:
17351  */
17352  __pyx_v_result->__pyx_base.view.suboffsets = NULL;
17353 
17354  /* "View.MemoryView":1032
17355  *
17356  * result.view.suboffsets = NULL
17357  * for suboffset in result.from_slice.suboffsets[:ndim]: # <<<<<<<<<<<<<<
17358  * if suboffset >= 0:
17359  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17360  */
17361  __pyx_t_7 = (__pyx_v_result->from_slice.suboffsets + __pyx_v_ndim);
17362  for (__pyx_t_8 = __pyx_v_result->from_slice.suboffsets; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17363  __pyx_t_6 = __pyx_t_8;
17364  __pyx_v_suboffset = (__pyx_t_6[0]);
17365 
17366  /* "View.MemoryView":1033
17367  * result.view.suboffsets = NULL
17368  * for suboffset in result.from_slice.suboffsets[:ndim]:
17369  * if suboffset >= 0: # <<<<<<<<<<<<<<
17370  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17371  * break
17372  */
17373  __pyx_t_1 = ((__pyx_v_suboffset >= 0) != 0);
17374  if (__pyx_t_1) {
17375 
17376  /* "View.MemoryView":1034
17377  * for suboffset in result.from_slice.suboffsets[:ndim]:
17378  * if suboffset >= 0:
17379  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets # <<<<<<<<<<<<<<
17380  * break
17381  *
17382  */
17383  __pyx_v_result->__pyx_base.view.suboffsets = ((Py_ssize_t *)__pyx_v_result->from_slice.suboffsets);
17384 
17385  /* "View.MemoryView":1035
17386  * if suboffset >= 0:
17387  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17388  * break # <<<<<<<<<<<<<<
17389  *
17390  * result.view.len = result.view.itemsize
17391  */
17392  goto __pyx_L6_break;
17393 
17394  /* "View.MemoryView":1033
17395  * result.view.suboffsets = NULL
17396  * for suboffset in result.from_slice.suboffsets[:ndim]:
17397  * if suboffset >= 0: # <<<<<<<<<<<<<<
17398  * result.view.suboffsets = <Py_ssize_t *> result.from_slice.suboffsets
17399  * break
17400  */
17401  }
17402  }
17403  __pyx_L6_break:;
17404 
17405  /* "View.MemoryView":1037
17406  * break
17407  *
17408  * result.view.len = result.view.itemsize # <<<<<<<<<<<<<<
17409  * for length in result.view.shape[:ndim]:
17410  * result.view.len *= length
17411  */
17412  __pyx_t_9 = __pyx_v_result->__pyx_base.view.itemsize;
17413  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17414 
17415  /* "View.MemoryView":1038
17416  *
17417  * result.view.len = result.view.itemsize
17418  * for length in result.view.shape[:ndim]: # <<<<<<<<<<<<<<
17419  * result.view.len *= length
17420  *
17421  */
17422  __pyx_t_7 = (__pyx_v_result->__pyx_base.view.shape + __pyx_v_ndim);
17423  for (__pyx_t_8 = __pyx_v_result->__pyx_base.view.shape; __pyx_t_8 < __pyx_t_7; __pyx_t_8++) {
17424  __pyx_t_6 = __pyx_t_8;
17425  __pyx_t_2 = PyInt_FromSsize_t((__pyx_t_6[0])); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1038, __pyx_L1_error)
17426  __Pyx_GOTREF(__pyx_t_2);
17427  __Pyx_XDECREF_SET(__pyx_v_length, __pyx_t_2);
17428  __pyx_t_2 = 0;
17429 
17430  /* "View.MemoryView":1039
17431  * result.view.len = result.view.itemsize
17432  * for length in result.view.shape[:ndim]:
17433  * result.view.len *= length # <<<<<<<<<<<<<<
17434  *
17435  * result.to_object_func = to_object_func
17436  */
17437  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_result->__pyx_base.view.len); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1039, __pyx_L1_error)
17438  __Pyx_GOTREF(__pyx_t_2);
17439  __pyx_t_3 = PyNumber_InPlaceMultiply(__pyx_t_2, __pyx_v_length); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1039, __pyx_L1_error)
17440  __Pyx_GOTREF(__pyx_t_3);
17441  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
17442  __pyx_t_9 = __Pyx_PyIndex_AsSsize_t(__pyx_t_3); if (unlikely((__pyx_t_9 == (Py_ssize_t)-1) && PyErr_Occurred())) __PYX_ERR(0, 1039, __pyx_L1_error)
17443  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
17444  __pyx_v_result->__pyx_base.view.len = __pyx_t_9;
17445  }
17446 
17447  /* "View.MemoryView":1041
17448  * result.view.len *= length
17449  *
17450  * result.to_object_func = to_object_func # <<<<<<<<<<<<<<
17451  * result.to_dtype_func = to_dtype_func
17452  *
17453  */
17454  __pyx_v_result->to_object_func = __pyx_v_to_object_func;
17455 
17456  /* "View.MemoryView":1042
17457  *
17458  * result.to_object_func = to_object_func
17459  * result.to_dtype_func = to_dtype_func # <<<<<<<<<<<<<<
17460  *
17461  * return result
17462  */
17463  __pyx_v_result->to_dtype_func = __pyx_v_to_dtype_func;
17464 
17465  /* "View.MemoryView":1044
17466  * result.to_dtype_func = to_dtype_func
17467  *
17468  * return result # <<<<<<<<<<<<<<
17469  *
17470  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17471  */
17472  __Pyx_XDECREF(__pyx_r);
17473  __Pyx_INCREF(((PyObject *)__pyx_v_result));
17474  __pyx_r = ((PyObject *)__pyx_v_result);
17475  goto __pyx_L0;
17476 
17477  /* "View.MemoryView":994
17478  *
17479  * @cname('__pyx_memoryview_fromslice')
17480  * cdef memoryview_fromslice(__Pyx_memviewslice memviewslice, # <<<<<<<<<<<<<<
17481  * int ndim,
17482  * object (*to_object_func)(char *),
17483  */
17484 
17485  /* function exit code */
17486  __pyx_L1_error:;
17487  __Pyx_XDECREF(__pyx_t_2);
17488  __Pyx_XDECREF(__pyx_t_3);
17489  __Pyx_AddTraceback("View.MemoryView.memoryview_fromslice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17490  __pyx_r = 0;
17491  __pyx_L0:;
17492  __Pyx_XDECREF((PyObject *)__pyx_v_result);
17493  __Pyx_XDECREF(__pyx_v_length);
17494  __Pyx_XGIVEREF(__pyx_r);
17495  __Pyx_RefNannyFinishContext();
17496  return __pyx_r;
17497 }
17498 
17499 /* "View.MemoryView":1047
17500  *
17501  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17502  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17503  * __Pyx_memviewslice *mslice):
17504  * cdef _memoryviewslice obj
17505  */
17506 
17507 static __Pyx_memviewslice *__pyx_memoryview_get_slice_from_memoryview(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_mslice) {
17508  struct __pyx_memoryviewslice_obj *__pyx_v_obj = 0;
17509  __Pyx_memviewslice *__pyx_r;
17510  __Pyx_RefNannyDeclarations
17511  int __pyx_t_1;
17512  int __pyx_t_2;
17513  PyObject *__pyx_t_3 = NULL;
17514  __Pyx_RefNannySetupContext("get_slice_from_memview", 0);
17515 
17516  /* "View.MemoryView":1050
17517  * __Pyx_memviewslice *mslice):
17518  * cdef _memoryviewslice obj
17519  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17520  * obj = memview
17521  * return &obj.from_slice
17522  */
17523  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17524  __pyx_t_2 = (__pyx_t_1 != 0);
17525  if (__pyx_t_2) {
17526 
17527  /* "View.MemoryView":1051
17528  * cdef _memoryviewslice obj
17529  * if isinstance(memview, _memoryviewslice):
17530  * obj = memview # <<<<<<<<<<<<<<
17531  * return &obj.from_slice
17532  * else:
17533  */
17534  if (!(likely(((((PyObject *)__pyx_v_memview)) == Py_None) || likely(__Pyx_TypeTest(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type))))) __PYX_ERR(0, 1051, __pyx_L1_error)
17535  __pyx_t_3 = ((PyObject *)__pyx_v_memview);
17536  __Pyx_INCREF(__pyx_t_3);
17537  __pyx_v_obj = ((struct __pyx_memoryviewslice_obj *)__pyx_t_3);
17538  __pyx_t_3 = 0;
17539 
17540  /* "View.MemoryView":1052
17541  * if isinstance(memview, _memoryviewslice):
17542  * obj = memview
17543  * return &obj.from_slice # <<<<<<<<<<<<<<
17544  * else:
17545  * slice_copy(memview, mslice)
17546  */
17547  __pyx_r = (&__pyx_v_obj->from_slice);
17548  goto __pyx_L0;
17549 
17550  /* "View.MemoryView":1050
17551  * __Pyx_memviewslice *mslice):
17552  * cdef _memoryviewslice obj
17553  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17554  * obj = memview
17555  * return &obj.from_slice
17556  */
17557  }
17558 
17559  /* "View.MemoryView":1054
17560  * return &obj.from_slice
17561  * else:
17562  * slice_copy(memview, mslice) # <<<<<<<<<<<<<<
17563  * return mslice
17564  *
17565  */
17566  /*else*/ {
17567  __pyx_memoryview_slice_copy(__pyx_v_memview, __pyx_v_mslice);
17568 
17569  /* "View.MemoryView":1055
17570  * else:
17571  * slice_copy(memview, mslice)
17572  * return mslice # <<<<<<<<<<<<<<
17573  *
17574  * @cname('__pyx_memoryview_slice_copy')
17575  */
17576  __pyx_r = __pyx_v_mslice;
17577  goto __pyx_L0;
17578  }
17579 
17580  /* "View.MemoryView":1047
17581  *
17582  * @cname('__pyx_memoryview_get_slice_from_memoryview')
17583  * cdef __Pyx_memviewslice *get_slice_from_memview(memoryview memview, # <<<<<<<<<<<<<<
17584  * __Pyx_memviewslice *mslice):
17585  * cdef _memoryviewslice obj
17586  */
17587 
17588  /* function exit code */
17589  __pyx_L1_error:;
17590  __Pyx_XDECREF(__pyx_t_3);
17591  __Pyx_WriteUnraisable("View.MemoryView.get_slice_from_memview", __pyx_clineno, __pyx_lineno, __pyx_filename, 1, 0);
17592  __pyx_r = 0;
17593  __pyx_L0:;
17594  __Pyx_XDECREF((PyObject *)__pyx_v_obj);
17595  __Pyx_RefNannyFinishContext();
17596  return __pyx_r;
17597 }
17598 
17599 /* "View.MemoryView":1058
17600  *
17601  * @cname('__pyx_memoryview_slice_copy')
17602  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17603  * cdef int dim
17604  * cdef (Py_ssize_t*) shape, strides, suboffsets
17605  */
17606 
17607 static void __pyx_memoryview_slice_copy(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_dst) {
17608  int __pyx_v_dim;
17609  Py_ssize_t *__pyx_v_shape;
17610  Py_ssize_t *__pyx_v_strides;
17611  Py_ssize_t *__pyx_v_suboffsets;
17612  __Pyx_RefNannyDeclarations
17613  Py_ssize_t *__pyx_t_1;
17614  int __pyx_t_2;
17615  int __pyx_t_3;
17616  int __pyx_t_4;
17617  Py_ssize_t __pyx_t_5;
17618  __Pyx_RefNannySetupContext("slice_copy", 0);
17619 
17620  /* "View.MemoryView":1062
17621  * cdef (Py_ssize_t*) shape, strides, suboffsets
17622  *
17623  * shape = memview.view.shape # <<<<<<<<<<<<<<
17624  * strides = memview.view.strides
17625  * suboffsets = memview.view.suboffsets
17626  */
17627  __pyx_t_1 = __pyx_v_memview->view.shape;
17628  __pyx_v_shape = __pyx_t_1;
17629 
17630  /* "View.MemoryView":1063
17631  *
17632  * shape = memview.view.shape
17633  * strides = memview.view.strides # <<<<<<<<<<<<<<
17634  * suboffsets = memview.view.suboffsets
17635  *
17636  */
17637  __pyx_t_1 = __pyx_v_memview->view.strides;
17638  __pyx_v_strides = __pyx_t_1;
17639 
17640  /* "View.MemoryView":1064
17641  * shape = memview.view.shape
17642  * strides = memview.view.strides
17643  * suboffsets = memview.view.suboffsets # <<<<<<<<<<<<<<
17644  *
17645  * dst.memview = <__pyx_memoryview *> memview
17646  */
17647  __pyx_t_1 = __pyx_v_memview->view.suboffsets;
17648  __pyx_v_suboffsets = __pyx_t_1;
17649 
17650  /* "View.MemoryView":1066
17651  * suboffsets = memview.view.suboffsets
17652  *
17653  * dst.memview = <__pyx_memoryview *> memview # <<<<<<<<<<<<<<
17654  * dst.data = <char *> memview.view.buf
17655  *
17656  */
17657  __pyx_v_dst->memview = ((struct __pyx_memoryview_obj *)__pyx_v_memview);
17658 
17659  /* "View.MemoryView":1067
17660  *
17661  * dst.memview = <__pyx_memoryview *> memview
17662  * dst.data = <char *> memview.view.buf # <<<<<<<<<<<<<<
17663  *
17664  * for dim in range(memview.view.ndim):
17665  */
17666  __pyx_v_dst->data = ((char *)__pyx_v_memview->view.buf);
17667 
17668  /* "View.MemoryView":1069
17669  * dst.data = <char *> memview.view.buf
17670  *
17671  * for dim in range(memview.view.ndim): # <<<<<<<<<<<<<<
17672  * dst.shape[dim] = shape[dim]
17673  * dst.strides[dim] = strides[dim]
17674  */
17675  __pyx_t_2 = __pyx_v_memview->view.ndim;
17676  __pyx_t_3 = __pyx_t_2;
17677  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
17678  __pyx_v_dim = __pyx_t_4;
17679 
17680  /* "View.MemoryView":1070
17681  *
17682  * for dim in range(memview.view.ndim):
17683  * dst.shape[dim] = shape[dim] # <<<<<<<<<<<<<<
17684  * dst.strides[dim] = strides[dim]
17685  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17686  */
17687  (__pyx_v_dst->shape[__pyx_v_dim]) = (__pyx_v_shape[__pyx_v_dim]);
17688 
17689  /* "View.MemoryView":1071
17690  * for dim in range(memview.view.ndim):
17691  * dst.shape[dim] = shape[dim]
17692  * dst.strides[dim] = strides[dim] # <<<<<<<<<<<<<<
17693  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1
17694  *
17695  */
17696  (__pyx_v_dst->strides[__pyx_v_dim]) = (__pyx_v_strides[__pyx_v_dim]);
17697 
17698  /* "View.MemoryView":1072
17699  * dst.shape[dim] = shape[dim]
17700  * dst.strides[dim] = strides[dim]
17701  * dst.suboffsets[dim] = suboffsets[dim] if suboffsets else -1 # <<<<<<<<<<<<<<
17702  *
17703  * @cname('__pyx_memoryview_copy_object')
17704  */
17705  if ((__pyx_v_suboffsets != 0)) {
17706  __pyx_t_5 = (__pyx_v_suboffsets[__pyx_v_dim]);
17707  } else {
17708  __pyx_t_5 = -1L;
17709  }
17710  (__pyx_v_dst->suboffsets[__pyx_v_dim]) = __pyx_t_5;
17711  }
17712 
17713  /* "View.MemoryView":1058
17714  *
17715  * @cname('__pyx_memoryview_slice_copy')
17716  * cdef void slice_copy(memoryview memview, __Pyx_memviewslice *dst): # <<<<<<<<<<<<<<
17717  * cdef int dim
17718  * cdef (Py_ssize_t*) shape, strides, suboffsets
17719  */
17720 
17721  /* function exit code */
17722  __Pyx_RefNannyFinishContext();
17723 }
17724 
17725 /* "View.MemoryView":1075
17726  *
17727  * @cname('__pyx_memoryview_copy_object')
17728  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17729  * "Create a new memoryview object"
17730  * cdef __Pyx_memviewslice memviewslice
17731  */
17732 
17733 static PyObject *__pyx_memoryview_copy_object(struct __pyx_memoryview_obj *__pyx_v_memview) {
17734  __Pyx_memviewslice __pyx_v_memviewslice;
17735  PyObject *__pyx_r = NULL;
17736  __Pyx_RefNannyDeclarations
17737  PyObject *__pyx_t_1 = NULL;
17738  __Pyx_RefNannySetupContext("memoryview_copy", 0);
17739 
17740  /* "View.MemoryView":1078
17741  * "Create a new memoryview object"
17742  * cdef __Pyx_memviewslice memviewslice
17743  * slice_copy(memview, &memviewslice) # <<<<<<<<<<<<<<
17744  * return memoryview_copy_from_slice(memview, &memviewslice)
17745  *
17746  */
17747  __pyx_memoryview_slice_copy(__pyx_v_memview, (&__pyx_v_memviewslice));
17748 
17749  /* "View.MemoryView":1079
17750  * cdef __Pyx_memviewslice memviewslice
17751  * slice_copy(memview, &memviewslice)
17752  * return memoryview_copy_from_slice(memview, &memviewslice) # <<<<<<<<<<<<<<
17753  *
17754  * @cname('__pyx_memoryview_copy_object_from_slice')
17755  */
17756  __Pyx_XDECREF(__pyx_r);
17757  __pyx_t_1 = __pyx_memoryview_copy_object_from_slice(__pyx_v_memview, (&__pyx_v_memviewslice)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1079, __pyx_L1_error)
17758  __Pyx_GOTREF(__pyx_t_1);
17759  __pyx_r = __pyx_t_1;
17760  __pyx_t_1 = 0;
17761  goto __pyx_L0;
17762 
17763  /* "View.MemoryView":1075
17764  *
17765  * @cname('__pyx_memoryview_copy_object')
17766  * cdef memoryview_copy(memoryview memview): # <<<<<<<<<<<<<<
17767  * "Create a new memoryview object"
17768  * cdef __Pyx_memviewslice memviewslice
17769  */
17770 
17771  /* function exit code */
17772  __pyx_L1_error:;
17773  __Pyx_XDECREF(__pyx_t_1);
17774  __Pyx_AddTraceback("View.MemoryView.memoryview_copy", __pyx_clineno, __pyx_lineno, __pyx_filename);
17775  __pyx_r = 0;
17776  __pyx_L0:;
17777  __Pyx_XGIVEREF(__pyx_r);
17778  __Pyx_RefNannyFinishContext();
17779  return __pyx_r;
17780 }
17781 
17782 /* "View.MemoryView":1082
17783  *
17784  * @cname('__pyx_memoryview_copy_object_from_slice')
17785  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17786  * """
17787  * Create a new memoryview object from a given memoryview object and slice.
17788  */
17789 
17790 static PyObject *__pyx_memoryview_copy_object_from_slice(struct __pyx_memoryview_obj *__pyx_v_memview, __Pyx_memviewslice *__pyx_v_memviewslice) {
17791  PyObject *(*__pyx_v_to_object_func)(char *);
17792  int (*__pyx_v_to_dtype_func)(char *, PyObject *);
17793  PyObject *__pyx_r = NULL;
17794  __Pyx_RefNannyDeclarations
17795  int __pyx_t_1;
17796  int __pyx_t_2;
17797  PyObject *(*__pyx_t_3)(char *);
17798  int (*__pyx_t_4)(char *, PyObject *);
17799  PyObject *__pyx_t_5 = NULL;
17800  __Pyx_RefNannySetupContext("memoryview_copy_from_slice", 0);
17801 
17802  /* "View.MemoryView":1089
17803  * cdef int (*to_dtype_func)(char *, object) except 0
17804  *
17805  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17806  * to_object_func = (<_memoryviewslice> memview).to_object_func
17807  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17808  */
17809  __pyx_t_1 = __Pyx_TypeCheck(((PyObject *)__pyx_v_memview), __pyx_memoryviewslice_type);
17810  __pyx_t_2 = (__pyx_t_1 != 0);
17811  if (__pyx_t_2) {
17812 
17813  /* "View.MemoryView":1090
17814  *
17815  * if isinstance(memview, _memoryviewslice):
17816  * to_object_func = (<_memoryviewslice> memview).to_object_func # <<<<<<<<<<<<<<
17817  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17818  * else:
17819  */
17820  __pyx_t_3 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_object_func;
17821  __pyx_v_to_object_func = __pyx_t_3;
17822 
17823  /* "View.MemoryView":1091
17824  * if isinstance(memview, _memoryviewslice):
17825  * to_object_func = (<_memoryviewslice> memview).to_object_func
17826  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func # <<<<<<<<<<<<<<
17827  * else:
17828  * to_object_func = NULL
17829  */
17830  __pyx_t_4 = ((struct __pyx_memoryviewslice_obj *)__pyx_v_memview)->to_dtype_func;
17831  __pyx_v_to_dtype_func = __pyx_t_4;
17832 
17833  /* "View.MemoryView":1089
17834  * cdef int (*to_dtype_func)(char *, object) except 0
17835  *
17836  * if isinstance(memview, _memoryviewslice): # <<<<<<<<<<<<<<
17837  * to_object_func = (<_memoryviewslice> memview).to_object_func
17838  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17839  */
17840  goto __pyx_L3;
17841  }
17842 
17843  /* "View.MemoryView":1093
17844  * to_dtype_func = (<_memoryviewslice> memview).to_dtype_func
17845  * else:
17846  * to_object_func = NULL # <<<<<<<<<<<<<<
17847  * to_dtype_func = NULL
17848  *
17849  */
17850  /*else*/ {
17851  __pyx_v_to_object_func = NULL;
17852 
17853  /* "View.MemoryView":1094
17854  * else:
17855  * to_object_func = NULL
17856  * to_dtype_func = NULL # <<<<<<<<<<<<<<
17857  *
17858  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17859  */
17860  __pyx_v_to_dtype_func = NULL;
17861  }
17862  __pyx_L3:;
17863 
17864  /* "View.MemoryView":1096
17865  * to_dtype_func = NULL
17866  *
17867  * return memoryview_fromslice(memviewslice[0], memview.view.ndim, # <<<<<<<<<<<<<<
17868  * to_object_func, to_dtype_func,
17869  * memview.dtype_is_object)
17870  */
17871  __Pyx_XDECREF(__pyx_r);
17872 
17873  /* "View.MemoryView":1098
17874  * return memoryview_fromslice(memviewslice[0], memview.view.ndim,
17875  * to_object_func, to_dtype_func,
17876  * memview.dtype_is_object) # <<<<<<<<<<<<<<
17877  *
17878  *
17879  */
17880  __pyx_t_5 = __pyx_memoryview_fromslice((__pyx_v_memviewslice[0]), __pyx_v_memview->view.ndim, __pyx_v_to_object_func, __pyx_v_to_dtype_func, __pyx_v_memview->dtype_is_object); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1096, __pyx_L1_error)
17881  __Pyx_GOTREF(__pyx_t_5);
17882  __pyx_r = __pyx_t_5;
17883  __pyx_t_5 = 0;
17884  goto __pyx_L0;
17885 
17886  /* "View.MemoryView":1082
17887  *
17888  * @cname('__pyx_memoryview_copy_object_from_slice')
17889  * cdef memoryview_copy_from_slice(memoryview memview, __Pyx_memviewslice *memviewslice): # <<<<<<<<<<<<<<
17890  * """
17891  * Create a new memoryview object from a given memoryview object and slice.
17892  */
17893 
17894  /* function exit code */
17895  __pyx_L1_error:;
17896  __Pyx_XDECREF(__pyx_t_5);
17897  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_from_slice", __pyx_clineno, __pyx_lineno, __pyx_filename);
17898  __pyx_r = 0;
17899  __pyx_L0:;
17900  __Pyx_XGIVEREF(__pyx_r);
17901  __Pyx_RefNannyFinishContext();
17902  return __pyx_r;
17903 }
17904 
17905 /* "View.MemoryView":1104
17906  *
17907  *
17908  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17909  * if arg < 0:
17910  * return -arg
17911  */
17912 
17913 static Py_ssize_t abs_py_ssize_t(Py_ssize_t __pyx_v_arg) {
17914  Py_ssize_t __pyx_r;
17915  int __pyx_t_1;
17916 
17917  /* "View.MemoryView":1105
17918  *
17919  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17920  * if arg < 0: # <<<<<<<<<<<<<<
17921  * return -arg
17922  * else:
17923  */
17924  __pyx_t_1 = ((__pyx_v_arg < 0) != 0);
17925  if (__pyx_t_1) {
17926 
17927  /* "View.MemoryView":1106
17928  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17929  * if arg < 0:
17930  * return -arg # <<<<<<<<<<<<<<
17931  * else:
17932  * return arg
17933  */
17934  __pyx_r = (-__pyx_v_arg);
17935  goto __pyx_L0;
17936 
17937  /* "View.MemoryView":1105
17938  *
17939  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil:
17940  * if arg < 0: # <<<<<<<<<<<<<<
17941  * return -arg
17942  * else:
17943  */
17944  }
17945 
17946  /* "View.MemoryView":1108
17947  * return -arg
17948  * else:
17949  * return arg # <<<<<<<<<<<<<<
17950  *
17951  * @cname('__pyx_get_best_slice_order')
17952  */
17953  /*else*/ {
17954  __pyx_r = __pyx_v_arg;
17955  goto __pyx_L0;
17956  }
17957 
17958  /* "View.MemoryView":1104
17959  *
17960  *
17961  * cdef Py_ssize_t abs_py_ssize_t(Py_ssize_t arg) nogil: # <<<<<<<<<<<<<<
17962  * if arg < 0:
17963  * return -arg
17964  */
17965 
17966  /* function exit code */
17967  __pyx_L0:;
17968  return __pyx_r;
17969 }
17970 
17971 /* "View.MemoryView":1111
17972  *
17973  * @cname('__pyx_get_best_slice_order')
17974  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
17975  * """
17976  * Figure out the best memory access order for a given slice.
17977  */
17978 
17979 static char __pyx_get_best_slice_order(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim) {
17980  int __pyx_v_i;
17981  Py_ssize_t __pyx_v_c_stride;
17982  Py_ssize_t __pyx_v_f_stride;
17983  char __pyx_r;
17984  int __pyx_t_1;
17985  int __pyx_t_2;
17986  int __pyx_t_3;
17987  int __pyx_t_4;
17988 
17989  /* "View.MemoryView":1116
17990  * """
17991  * cdef int i
17992  * cdef Py_ssize_t c_stride = 0 # <<<<<<<<<<<<<<
17993  * cdef Py_ssize_t f_stride = 0
17994  *
17995  */
17996  __pyx_v_c_stride = 0;
17997 
17998  /* "View.MemoryView":1117
17999  * cdef int i
18000  * cdef Py_ssize_t c_stride = 0
18001  * cdef Py_ssize_t f_stride = 0 # <<<<<<<<<<<<<<
18002  *
18003  * for i in range(ndim - 1, -1, -1):
18004  */
18005  __pyx_v_f_stride = 0;
18006 
18007  /* "View.MemoryView":1119
18008  * cdef Py_ssize_t f_stride = 0
18009  *
18010  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18011  * if mslice.shape[i] > 1:
18012  * c_stride = mslice.strides[i]
18013  */
18014  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
18015  __pyx_v_i = __pyx_t_1;
18016 
18017  /* "View.MemoryView":1120
18018  *
18019  * for i in range(ndim - 1, -1, -1):
18020  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18021  * c_stride = mslice.strides[i]
18022  * break
18023  */
18024  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18025  if (__pyx_t_2) {
18026 
18027  /* "View.MemoryView":1121
18028  * for i in range(ndim - 1, -1, -1):
18029  * if mslice.shape[i] > 1:
18030  * c_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18031  * break
18032  *
18033  */
18034  __pyx_v_c_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18035 
18036  /* "View.MemoryView":1122
18037  * if mslice.shape[i] > 1:
18038  * c_stride = mslice.strides[i]
18039  * break # <<<<<<<<<<<<<<
18040  *
18041  * for i in range(ndim):
18042  */
18043  goto __pyx_L4_break;
18044 
18045  /* "View.MemoryView":1120
18046  *
18047  * for i in range(ndim - 1, -1, -1):
18048  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18049  * c_stride = mslice.strides[i]
18050  * break
18051  */
18052  }
18053  }
18054  __pyx_L4_break:;
18055 
18056  /* "View.MemoryView":1124
18057  * break
18058  *
18059  * for i in range(ndim): # <<<<<<<<<<<<<<
18060  * if mslice.shape[i] > 1:
18061  * f_stride = mslice.strides[i]
18062  */
18063  __pyx_t_1 = __pyx_v_ndim;
18064  __pyx_t_3 = __pyx_t_1;
18065  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18066  __pyx_v_i = __pyx_t_4;
18067 
18068  /* "View.MemoryView":1125
18069  *
18070  * for i in range(ndim):
18071  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18072  * f_stride = mslice.strides[i]
18073  * break
18074  */
18075  __pyx_t_2 = (((__pyx_v_mslice->shape[__pyx_v_i]) > 1) != 0);
18076  if (__pyx_t_2) {
18077 
18078  /* "View.MemoryView":1126
18079  * for i in range(ndim):
18080  * if mslice.shape[i] > 1:
18081  * f_stride = mslice.strides[i] # <<<<<<<<<<<<<<
18082  * break
18083  *
18084  */
18085  __pyx_v_f_stride = (__pyx_v_mslice->strides[__pyx_v_i]);
18086 
18087  /* "View.MemoryView":1127
18088  * if mslice.shape[i] > 1:
18089  * f_stride = mslice.strides[i]
18090  * break # <<<<<<<<<<<<<<
18091  *
18092  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18093  */
18094  goto __pyx_L7_break;
18095 
18096  /* "View.MemoryView":1125
18097  *
18098  * for i in range(ndim):
18099  * if mslice.shape[i] > 1: # <<<<<<<<<<<<<<
18100  * f_stride = mslice.strides[i]
18101  * break
18102  */
18103  }
18104  }
18105  __pyx_L7_break:;
18106 
18107  /* "View.MemoryView":1129
18108  * break
18109  *
18110  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18111  * return 'C'
18112  * else:
18113  */
18114  __pyx_t_2 = ((abs_py_ssize_t(__pyx_v_c_stride) <= abs_py_ssize_t(__pyx_v_f_stride)) != 0);
18115  if (__pyx_t_2) {
18116 
18117  /* "View.MemoryView":1130
18118  *
18119  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride):
18120  * return 'C' # <<<<<<<<<<<<<<
18121  * else:
18122  * return 'F'
18123  */
18124  __pyx_r = 'C';
18125  goto __pyx_L0;
18126 
18127  /* "View.MemoryView":1129
18128  * break
18129  *
18130  * if abs_py_ssize_t(c_stride) <= abs_py_ssize_t(f_stride): # <<<<<<<<<<<<<<
18131  * return 'C'
18132  * else:
18133  */
18134  }
18135 
18136  /* "View.MemoryView":1132
18137  * return 'C'
18138  * else:
18139  * return 'F' # <<<<<<<<<<<<<<
18140  *
18141  * @cython.cdivision(True)
18142  */
18143  /*else*/ {
18144  __pyx_r = 'F';
18145  goto __pyx_L0;
18146  }
18147 
18148  /* "View.MemoryView":1111
18149  *
18150  * @cname('__pyx_get_best_slice_order')
18151  * cdef char get_best_order(__Pyx_memviewslice *mslice, int ndim) nogil: # <<<<<<<<<<<<<<
18152  * """
18153  * Figure out the best memory access order for a given slice.
18154  */
18155 
18156  /* function exit code */
18157  __pyx_L0:;
18158  return __pyx_r;
18159 }
18160 
18161 /* "View.MemoryView":1135
18162  *
18163  * @cython.cdivision(True)
18164  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18165  * char *dst_data, Py_ssize_t *dst_strides,
18166  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18167  */
18168 
18169 static void _copy_strided_to_strided(char *__pyx_v_src_data, Py_ssize_t *__pyx_v_src_strides, char *__pyx_v_dst_data, Py_ssize_t *__pyx_v_dst_strides, Py_ssize_t *__pyx_v_src_shape, Py_ssize_t *__pyx_v_dst_shape, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18170  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
18171  CYTHON_UNUSED Py_ssize_t __pyx_v_src_extent;
18172  Py_ssize_t __pyx_v_dst_extent;
18173  Py_ssize_t __pyx_v_src_stride;
18174  Py_ssize_t __pyx_v_dst_stride;
18175  int __pyx_t_1;
18176  int __pyx_t_2;
18177  int __pyx_t_3;
18178  Py_ssize_t __pyx_t_4;
18179  Py_ssize_t __pyx_t_5;
18180  Py_ssize_t __pyx_t_6;
18181 
18182  /* "View.MemoryView":1142
18183  *
18184  * cdef Py_ssize_t i
18185  * cdef Py_ssize_t src_extent = src_shape[0] # <<<<<<<<<<<<<<
18186  * cdef Py_ssize_t dst_extent = dst_shape[0]
18187  * cdef Py_ssize_t src_stride = src_strides[0]
18188  */
18189  __pyx_v_src_extent = (__pyx_v_src_shape[0]);
18190 
18191  /* "View.MemoryView":1143
18192  * cdef Py_ssize_t i
18193  * cdef Py_ssize_t src_extent = src_shape[0]
18194  * cdef Py_ssize_t dst_extent = dst_shape[0] # <<<<<<<<<<<<<<
18195  * cdef Py_ssize_t src_stride = src_strides[0]
18196  * cdef Py_ssize_t dst_stride = dst_strides[0]
18197  */
18198  __pyx_v_dst_extent = (__pyx_v_dst_shape[0]);
18199 
18200  /* "View.MemoryView":1144
18201  * cdef Py_ssize_t src_extent = src_shape[0]
18202  * cdef Py_ssize_t dst_extent = dst_shape[0]
18203  * cdef Py_ssize_t src_stride = src_strides[0] # <<<<<<<<<<<<<<
18204  * cdef Py_ssize_t dst_stride = dst_strides[0]
18205  *
18206  */
18207  __pyx_v_src_stride = (__pyx_v_src_strides[0]);
18208 
18209  /* "View.MemoryView":1145
18210  * cdef Py_ssize_t dst_extent = dst_shape[0]
18211  * cdef Py_ssize_t src_stride = src_strides[0]
18212  * cdef Py_ssize_t dst_stride = dst_strides[0] # <<<<<<<<<<<<<<
18213  *
18214  * if ndim == 1:
18215  */
18216  __pyx_v_dst_stride = (__pyx_v_dst_strides[0]);
18217 
18218  /* "View.MemoryView":1147
18219  * cdef Py_ssize_t dst_stride = dst_strides[0]
18220  *
18221  * if ndim == 1: # <<<<<<<<<<<<<<
18222  * if (src_stride > 0 and dst_stride > 0 and
18223  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18224  */
18225  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
18226  if (__pyx_t_1) {
18227 
18228  /* "View.MemoryView":1148
18229  *
18230  * if ndim == 1:
18231  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18232  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18233  * memcpy(dst_data, src_data, itemsize * dst_extent)
18234  */
18235  __pyx_t_2 = ((__pyx_v_src_stride > 0) != 0);
18236  if (__pyx_t_2) {
18237  } else {
18238  __pyx_t_1 = __pyx_t_2;
18239  goto __pyx_L5_bool_binop_done;
18240  }
18241  __pyx_t_2 = ((__pyx_v_dst_stride > 0) != 0);
18242  if (__pyx_t_2) {
18243  } else {
18244  __pyx_t_1 = __pyx_t_2;
18245  goto __pyx_L5_bool_binop_done;
18246  }
18247 
18248  /* "View.MemoryView":1149
18249  * if ndim == 1:
18250  * if (src_stride > 0 and dst_stride > 0 and
18251  * <size_t> src_stride == itemsize == <size_t> dst_stride): # <<<<<<<<<<<<<<
18252  * memcpy(dst_data, src_data, itemsize * dst_extent)
18253  * else:
18254  */
18255  __pyx_t_2 = (((size_t)__pyx_v_src_stride) == __pyx_v_itemsize);
18256  if (__pyx_t_2) {
18257  __pyx_t_2 = (__pyx_v_itemsize == ((size_t)__pyx_v_dst_stride));
18258  }
18259  __pyx_t_3 = (__pyx_t_2 != 0);
18260  __pyx_t_1 = __pyx_t_3;
18261  __pyx_L5_bool_binop_done:;
18262 
18263  /* "View.MemoryView":1148
18264  *
18265  * if ndim == 1:
18266  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18267  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18268  * memcpy(dst_data, src_data, itemsize * dst_extent)
18269  */
18270  if (__pyx_t_1) {
18271 
18272  /* "View.MemoryView":1150
18273  * if (src_stride > 0 and dst_stride > 0 and
18274  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18275  * memcpy(dst_data, src_data, itemsize * dst_extent) # <<<<<<<<<<<<<<
18276  * else:
18277  * for i in range(dst_extent):
18278  */
18279  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, (__pyx_v_itemsize * __pyx_v_dst_extent)));
18280 
18281  /* "View.MemoryView":1148
18282  *
18283  * if ndim == 1:
18284  * if (src_stride > 0 and dst_stride > 0 and # <<<<<<<<<<<<<<
18285  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18286  * memcpy(dst_data, src_data, itemsize * dst_extent)
18287  */
18288  goto __pyx_L4;
18289  }
18290 
18291  /* "View.MemoryView":1152
18292  * memcpy(dst_data, src_data, itemsize * dst_extent)
18293  * else:
18294  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18295  * memcpy(dst_data, src_data, itemsize)
18296  * src_data += src_stride
18297  */
18298  /*else*/ {
18299  __pyx_t_4 = __pyx_v_dst_extent;
18300  __pyx_t_5 = __pyx_t_4;
18301  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18302  __pyx_v_i = __pyx_t_6;
18303 
18304  /* "View.MemoryView":1153
18305  * else:
18306  * for i in range(dst_extent):
18307  * memcpy(dst_data, src_data, itemsize) # <<<<<<<<<<<<<<
18308  * src_data += src_stride
18309  * dst_data += dst_stride
18310  */
18311  (void)(memcpy(__pyx_v_dst_data, __pyx_v_src_data, __pyx_v_itemsize));
18312 
18313  /* "View.MemoryView":1154
18314  * for i in range(dst_extent):
18315  * memcpy(dst_data, src_data, itemsize)
18316  * src_data += src_stride # <<<<<<<<<<<<<<
18317  * dst_data += dst_stride
18318  * else:
18319  */
18320  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18321 
18322  /* "View.MemoryView":1155
18323  * memcpy(dst_data, src_data, itemsize)
18324  * src_data += src_stride
18325  * dst_data += dst_stride # <<<<<<<<<<<<<<
18326  * else:
18327  * for i in range(dst_extent):
18328  */
18329  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18330  }
18331  }
18332  __pyx_L4:;
18333 
18334  /* "View.MemoryView":1147
18335  * cdef Py_ssize_t dst_stride = dst_strides[0]
18336  *
18337  * if ndim == 1: # <<<<<<<<<<<<<<
18338  * if (src_stride > 0 and dst_stride > 0 and
18339  * <size_t> src_stride == itemsize == <size_t> dst_stride):
18340  */
18341  goto __pyx_L3;
18342  }
18343 
18344  /* "View.MemoryView":1157
18345  * dst_data += dst_stride
18346  * else:
18347  * for i in range(dst_extent): # <<<<<<<<<<<<<<
18348  * _copy_strided_to_strided(src_data, src_strides + 1,
18349  * dst_data, dst_strides + 1,
18350  */
18351  /*else*/ {
18352  __pyx_t_4 = __pyx_v_dst_extent;
18353  __pyx_t_5 = __pyx_t_4;
18354  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18355  __pyx_v_i = __pyx_t_6;
18356 
18357  /* "View.MemoryView":1158
18358  * else:
18359  * for i in range(dst_extent):
18360  * _copy_strided_to_strided(src_data, src_strides + 1, # <<<<<<<<<<<<<<
18361  * dst_data, dst_strides + 1,
18362  * src_shape + 1, dst_shape + 1,
18363  */
18364  _copy_strided_to_strided(__pyx_v_src_data, (__pyx_v_src_strides + 1), __pyx_v_dst_data, (__pyx_v_dst_strides + 1), (__pyx_v_src_shape + 1), (__pyx_v_dst_shape + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize);
18365 
18366  /* "View.MemoryView":1162
18367  * src_shape + 1, dst_shape + 1,
18368  * ndim - 1, itemsize)
18369  * src_data += src_stride # <<<<<<<<<<<<<<
18370  * dst_data += dst_stride
18371  *
18372  */
18373  __pyx_v_src_data = (__pyx_v_src_data + __pyx_v_src_stride);
18374 
18375  /* "View.MemoryView":1163
18376  * ndim - 1, itemsize)
18377  * src_data += src_stride
18378  * dst_data += dst_stride # <<<<<<<<<<<<<<
18379  *
18380  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src,
18381  */
18382  __pyx_v_dst_data = (__pyx_v_dst_data + __pyx_v_dst_stride);
18383  }
18384  }
18385  __pyx_L3:;
18386 
18387  /* "View.MemoryView":1135
18388  *
18389  * @cython.cdivision(True)
18390  * cdef void _copy_strided_to_strided(char *src_data, Py_ssize_t *src_strides, # <<<<<<<<<<<<<<
18391  * char *dst_data, Py_ssize_t *dst_strides,
18392  * Py_ssize_t *src_shape, Py_ssize_t *dst_shape,
18393  */
18394 
18395  /* function exit code */
18396 }
18397 
18398 /* "View.MemoryView":1165
18399  * dst_data += dst_stride
18400  *
18401  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18402  * __Pyx_memviewslice *dst,
18403  * int ndim, size_t itemsize) nogil:
18404  */
18405 
18406 static void copy_strided_to_strided(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize) {
18407 
18408  /* "View.MemoryView":1168
18409  * __Pyx_memviewslice *dst,
18410  * int ndim, size_t itemsize) nogil:
18411  * _copy_strided_to_strided(src.data, src.strides, dst.data, dst.strides, # <<<<<<<<<<<<<<
18412  * src.shape, dst.shape, ndim, itemsize)
18413  *
18414  */
18415  _copy_strided_to_strided(__pyx_v_src->data, __pyx_v_src->strides, __pyx_v_dst->data, __pyx_v_dst->strides, __pyx_v_src->shape, __pyx_v_dst->shape, __pyx_v_ndim, __pyx_v_itemsize);
18416 
18417  /* "View.MemoryView":1165
18418  * dst_data += dst_stride
18419  *
18420  * cdef void copy_strided_to_strided(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18421  * __Pyx_memviewslice *dst,
18422  * int ndim, size_t itemsize) nogil:
18423  */
18424 
18425  /* function exit code */
18426 }
18427 
18428 /* "View.MemoryView":1172
18429  *
18430  * @cname('__pyx_memoryview_slice_get_size')
18431  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18432  * "Return the size of the memory occupied by the slice in number of bytes"
18433  * cdef int i
18434  */
18435 
18436 static Py_ssize_t __pyx_memoryview_slice_get_size(__Pyx_memviewslice *__pyx_v_src, int __pyx_v_ndim) {
18437  int __pyx_v_i;
18438  Py_ssize_t __pyx_v_size;
18439  Py_ssize_t __pyx_r;
18440  Py_ssize_t __pyx_t_1;
18441  int __pyx_t_2;
18442  int __pyx_t_3;
18443  int __pyx_t_4;
18444 
18445  /* "View.MemoryView":1175
18446  * "Return the size of the memory occupied by the slice in number of bytes"
18447  * cdef int i
18448  * cdef Py_ssize_t size = src.memview.view.itemsize # <<<<<<<<<<<<<<
18449  *
18450  * for i in range(ndim):
18451  */
18452  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18453  __pyx_v_size = __pyx_t_1;
18454 
18455  /* "View.MemoryView":1177
18456  * cdef Py_ssize_t size = src.memview.view.itemsize
18457  *
18458  * for i in range(ndim): # <<<<<<<<<<<<<<
18459  * size *= src.shape[i]
18460  *
18461  */
18462  __pyx_t_2 = __pyx_v_ndim;
18463  __pyx_t_3 = __pyx_t_2;
18464  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18465  __pyx_v_i = __pyx_t_4;
18466 
18467  /* "View.MemoryView":1178
18468  *
18469  * for i in range(ndim):
18470  * size *= src.shape[i] # <<<<<<<<<<<<<<
18471  *
18472  * return size
18473  */
18474  __pyx_v_size = (__pyx_v_size * (__pyx_v_src->shape[__pyx_v_i]));
18475  }
18476 
18477  /* "View.MemoryView":1180
18478  * size *= src.shape[i]
18479  *
18480  * return size # <<<<<<<<<<<<<<
18481  *
18482  * @cname('__pyx_fill_contig_strides_array')
18483  */
18484  __pyx_r = __pyx_v_size;
18485  goto __pyx_L0;
18486 
18487  /* "View.MemoryView":1172
18488  *
18489  * @cname('__pyx_memoryview_slice_get_size')
18490  * cdef Py_ssize_t slice_get_size(__Pyx_memviewslice *src, int ndim) nogil: # <<<<<<<<<<<<<<
18491  * "Return the size of the memory occupied by the slice in number of bytes"
18492  * cdef int i
18493  */
18494 
18495  /* function exit code */
18496  __pyx_L0:;
18497  return __pyx_r;
18498 }
18499 
18500 /* "View.MemoryView":1183
18501  *
18502  * @cname('__pyx_fill_contig_strides_array')
18503  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18504  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18505  * int ndim, char order) nogil:
18506  */
18507 
18508 static Py_ssize_t __pyx_fill_contig_strides_array(Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, Py_ssize_t __pyx_v_stride, int __pyx_v_ndim, char __pyx_v_order) {
18509  int __pyx_v_idx;
18510  Py_ssize_t __pyx_r;
18511  int __pyx_t_1;
18512  int __pyx_t_2;
18513  int __pyx_t_3;
18514  int __pyx_t_4;
18515 
18516  /* "View.MemoryView":1192
18517  * cdef int idx
18518  *
18519  * if order == 'F': # <<<<<<<<<<<<<<
18520  * for idx in range(ndim):
18521  * strides[idx] = stride
18522  */
18523  __pyx_t_1 = ((__pyx_v_order == 'F') != 0);
18524  if (__pyx_t_1) {
18525 
18526  /* "View.MemoryView":1193
18527  *
18528  * if order == 'F':
18529  * for idx in range(ndim): # <<<<<<<<<<<<<<
18530  * strides[idx] = stride
18531  * stride = stride * shape[idx]
18532  */
18533  __pyx_t_2 = __pyx_v_ndim;
18534  __pyx_t_3 = __pyx_t_2;
18535  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
18536  __pyx_v_idx = __pyx_t_4;
18537 
18538  /* "View.MemoryView":1194
18539  * if order == 'F':
18540  * for idx in range(ndim):
18541  * strides[idx] = stride # <<<<<<<<<<<<<<
18542  * stride = stride * shape[idx]
18543  * else:
18544  */
18545  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18546 
18547  /* "View.MemoryView":1195
18548  * for idx in range(ndim):
18549  * strides[idx] = stride
18550  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
18551  * else:
18552  * for idx in range(ndim - 1, -1, -1):
18553  */
18554  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18555  }
18556 
18557  /* "View.MemoryView":1192
18558  * cdef int idx
18559  *
18560  * if order == 'F': # <<<<<<<<<<<<<<
18561  * for idx in range(ndim):
18562  * strides[idx] = stride
18563  */
18564  goto __pyx_L3;
18565  }
18566 
18567  /* "View.MemoryView":1197
18568  * stride = stride * shape[idx]
18569  * else:
18570  * for idx in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
18571  * strides[idx] = stride
18572  * stride = stride * shape[idx]
18573  */
18574  /*else*/ {
18575  for (__pyx_t_2 = (__pyx_v_ndim - 1); __pyx_t_2 > -1; __pyx_t_2-=1) {
18576  __pyx_v_idx = __pyx_t_2;
18577 
18578  /* "View.MemoryView":1198
18579  * else:
18580  * for idx in range(ndim - 1, -1, -1):
18581  * strides[idx] = stride # <<<<<<<<<<<<<<
18582  * stride = stride * shape[idx]
18583  *
18584  */
18585  (__pyx_v_strides[__pyx_v_idx]) = __pyx_v_stride;
18586 
18587  /* "View.MemoryView":1199
18588  * for idx in range(ndim - 1, -1, -1):
18589  * strides[idx] = stride
18590  * stride = stride * shape[idx] # <<<<<<<<<<<<<<
18591  *
18592  * return stride
18593  */
18594  __pyx_v_stride = (__pyx_v_stride * (__pyx_v_shape[__pyx_v_idx]));
18595  }
18596  }
18597  __pyx_L3:;
18598 
18599  /* "View.MemoryView":1201
18600  * stride = stride * shape[idx]
18601  *
18602  * return stride # <<<<<<<<<<<<<<
18603  *
18604  * @cname('__pyx_memoryview_copy_data_to_temp')
18605  */
18606  __pyx_r = __pyx_v_stride;
18607  goto __pyx_L0;
18608 
18609  /* "View.MemoryView":1183
18610  *
18611  * @cname('__pyx_fill_contig_strides_array')
18612  * cdef Py_ssize_t fill_contig_strides_array( # <<<<<<<<<<<<<<
18613  * Py_ssize_t *shape, Py_ssize_t *strides, Py_ssize_t stride,
18614  * int ndim, char order) nogil:
18615  */
18616 
18617  /* function exit code */
18618  __pyx_L0:;
18619  return __pyx_r;
18620 }
18621 
18622 /* "View.MemoryView":1204
18623  *
18624  * @cname('__pyx_memoryview_copy_data_to_temp')
18625  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18626  * __Pyx_memviewslice *tmpslice,
18627  * char order,
18628  */
18629 
18630 static void *__pyx_memoryview_copy_data_to_temp(__Pyx_memviewslice *__pyx_v_src, __Pyx_memviewslice *__pyx_v_tmpslice, char __pyx_v_order, int __pyx_v_ndim) {
18631  int __pyx_v_i;
18632  void *__pyx_v_result;
18633  size_t __pyx_v_itemsize;
18634  size_t __pyx_v_size;
18635  void *__pyx_r;
18636  Py_ssize_t __pyx_t_1;
18637  int __pyx_t_2;
18638  int __pyx_t_3;
18639  struct __pyx_memoryview_obj *__pyx_t_4;
18640  int __pyx_t_5;
18641  int __pyx_t_6;
18642 
18643  /* "View.MemoryView":1215
18644  * cdef void *result
18645  *
18646  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
18647  * cdef size_t size = slice_get_size(src, ndim)
18648  *
18649  */
18650  __pyx_t_1 = __pyx_v_src->memview->view.itemsize;
18651  __pyx_v_itemsize = __pyx_t_1;
18652 
18653  /* "View.MemoryView":1216
18654  *
18655  * cdef size_t itemsize = src.memview.view.itemsize
18656  * cdef size_t size = slice_get_size(src, ndim) # <<<<<<<<<<<<<<
18657  *
18658  * result = malloc(size)
18659  */
18660  __pyx_v_size = __pyx_memoryview_slice_get_size(__pyx_v_src, __pyx_v_ndim);
18661 
18662  /* "View.MemoryView":1218
18663  * cdef size_t size = slice_get_size(src, ndim)
18664  *
18665  * result = malloc(size) # <<<<<<<<<<<<<<
18666  * if not result:
18667  * _err(MemoryError, NULL)
18668  */
18669  __pyx_v_result = malloc(__pyx_v_size);
18670 
18671  /* "View.MemoryView":1219
18672  *
18673  * result = malloc(size)
18674  * if not result: # <<<<<<<<<<<<<<
18675  * _err(MemoryError, NULL)
18676  *
18677  */
18678  __pyx_t_2 = ((!(__pyx_v_result != 0)) != 0);
18679  if (__pyx_t_2) {
18680 
18681  /* "View.MemoryView":1220
18682  * result = malloc(size)
18683  * if not result:
18684  * _err(MemoryError, NULL) # <<<<<<<<<<<<<<
18685  *
18686  *
18687  */
18688  __pyx_t_3 = __pyx_memoryview_err(__pyx_builtin_MemoryError, NULL); if (unlikely(__pyx_t_3 == ((int)-1))) __PYX_ERR(0, 1220, __pyx_L1_error)
18689 
18690  /* "View.MemoryView":1219
18691  *
18692  * result = malloc(size)
18693  * if not result: # <<<<<<<<<<<<<<
18694  * _err(MemoryError, NULL)
18695  *
18696  */
18697  }
18698 
18699  /* "View.MemoryView":1223
18700  *
18701  *
18702  * tmpslice.data = <char *> result # <<<<<<<<<<<<<<
18703  * tmpslice.memview = src.memview
18704  * for i in range(ndim):
18705  */
18706  __pyx_v_tmpslice->data = ((char *)__pyx_v_result);
18707 
18708  /* "View.MemoryView":1224
18709  *
18710  * tmpslice.data = <char *> result
18711  * tmpslice.memview = src.memview # <<<<<<<<<<<<<<
18712  * for i in range(ndim):
18713  * tmpslice.shape[i] = src.shape[i]
18714  */
18715  __pyx_t_4 = __pyx_v_src->memview;
18716  __pyx_v_tmpslice->memview = __pyx_t_4;
18717 
18718  /* "View.MemoryView":1225
18719  * tmpslice.data = <char *> result
18720  * tmpslice.memview = src.memview
18721  * for i in range(ndim): # <<<<<<<<<<<<<<
18722  * tmpslice.shape[i] = src.shape[i]
18723  * tmpslice.suboffsets[i] = -1
18724  */
18725  __pyx_t_3 = __pyx_v_ndim;
18726  __pyx_t_5 = __pyx_t_3;
18727  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18728  __pyx_v_i = __pyx_t_6;
18729 
18730  /* "View.MemoryView":1226
18731  * tmpslice.memview = src.memview
18732  * for i in range(ndim):
18733  * tmpslice.shape[i] = src.shape[i] # <<<<<<<<<<<<<<
18734  * tmpslice.suboffsets[i] = -1
18735  *
18736  */
18737  (__pyx_v_tmpslice->shape[__pyx_v_i]) = (__pyx_v_src->shape[__pyx_v_i]);
18738 
18739  /* "View.MemoryView":1227
18740  * for i in range(ndim):
18741  * tmpslice.shape[i] = src.shape[i]
18742  * tmpslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
18743  *
18744  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize,
18745  */
18746  (__pyx_v_tmpslice->suboffsets[__pyx_v_i]) = -1L;
18747  }
18748 
18749  /* "View.MemoryView":1229
18750  * tmpslice.suboffsets[i] = -1
18751  *
18752  * fill_contig_strides_array(&tmpslice.shape[0], &tmpslice.strides[0], itemsize, # <<<<<<<<<<<<<<
18753  * ndim, order)
18754  *
18755  */
18756  (void)(__pyx_fill_contig_strides_array((&(__pyx_v_tmpslice->shape[0])), (&(__pyx_v_tmpslice->strides[0])), __pyx_v_itemsize, __pyx_v_ndim, __pyx_v_order));
18757 
18758  /* "View.MemoryView":1233
18759  *
18760  *
18761  * for i in range(ndim): # <<<<<<<<<<<<<<
18762  * if tmpslice.shape[i] == 1:
18763  * tmpslice.strides[i] = 0
18764  */
18765  __pyx_t_3 = __pyx_v_ndim;
18766  __pyx_t_5 = __pyx_t_3;
18767  for (__pyx_t_6 = 0; __pyx_t_6 < __pyx_t_5; __pyx_t_6+=1) {
18768  __pyx_v_i = __pyx_t_6;
18769 
18770  /* "View.MemoryView":1234
18771  *
18772  * for i in range(ndim):
18773  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18774  * tmpslice.strides[i] = 0
18775  *
18776  */
18777  __pyx_t_2 = (((__pyx_v_tmpslice->shape[__pyx_v_i]) == 1) != 0);
18778  if (__pyx_t_2) {
18779 
18780  /* "View.MemoryView":1235
18781  * for i in range(ndim):
18782  * if tmpslice.shape[i] == 1:
18783  * tmpslice.strides[i] = 0 # <<<<<<<<<<<<<<
18784  *
18785  * if slice_is_contig(src[0], order, ndim):
18786  */
18787  (__pyx_v_tmpslice->strides[__pyx_v_i]) = 0;
18788 
18789  /* "View.MemoryView":1234
18790  *
18791  * for i in range(ndim):
18792  * if tmpslice.shape[i] == 1: # <<<<<<<<<<<<<<
18793  * tmpslice.strides[i] = 0
18794  *
18795  */
18796  }
18797  }
18798 
18799  /* "View.MemoryView":1237
18800  * tmpslice.strides[i] = 0
18801  *
18802  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18803  * memcpy(result, src.data, size)
18804  * else:
18805  */
18806  __pyx_t_2 = (__pyx_memviewslice_is_contig((__pyx_v_src[0]), __pyx_v_order, __pyx_v_ndim) != 0);
18807  if (__pyx_t_2) {
18808 
18809  /* "View.MemoryView":1238
18810  *
18811  * if slice_is_contig(src[0], order, ndim):
18812  * memcpy(result, src.data, size) # <<<<<<<<<<<<<<
18813  * else:
18814  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18815  */
18816  (void)(memcpy(__pyx_v_result, __pyx_v_src->data, __pyx_v_size));
18817 
18818  /* "View.MemoryView":1237
18819  * tmpslice.strides[i] = 0
18820  *
18821  * if slice_is_contig(src[0], order, ndim): # <<<<<<<<<<<<<<
18822  * memcpy(result, src.data, size)
18823  * else:
18824  */
18825  goto __pyx_L9;
18826  }
18827 
18828  /* "View.MemoryView":1240
18829  * memcpy(result, src.data, size)
18830  * else:
18831  * copy_strided_to_strided(src, tmpslice, ndim, itemsize) # <<<<<<<<<<<<<<
18832  *
18833  * return result
18834  */
18835  /*else*/ {
18836  copy_strided_to_strided(__pyx_v_src, __pyx_v_tmpslice, __pyx_v_ndim, __pyx_v_itemsize);
18837  }
18838  __pyx_L9:;
18839 
18840  /* "View.MemoryView":1242
18841  * copy_strided_to_strided(src, tmpslice, ndim, itemsize)
18842  *
18843  * return result # <<<<<<<<<<<<<<
18844  *
18845  *
18846  */
18847  __pyx_r = __pyx_v_result;
18848  goto __pyx_L0;
18849 
18850  /* "View.MemoryView":1204
18851  *
18852  * @cname('__pyx_memoryview_copy_data_to_temp')
18853  * cdef void *copy_data_to_temp(__Pyx_memviewslice *src, # <<<<<<<<<<<<<<
18854  * __Pyx_memviewslice *tmpslice,
18855  * char order,
18856  */
18857 
18858  /* function exit code */
18859  __pyx_L1_error:;
18860  {
18861  #ifdef WITH_THREAD
18862  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18863  #endif
18864  __Pyx_AddTraceback("View.MemoryView.copy_data_to_temp", __pyx_clineno, __pyx_lineno, __pyx_filename);
18865  #ifdef WITH_THREAD
18866  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18867  #endif
18868  }
18869  __pyx_r = NULL;
18870  __pyx_L0:;
18871  return __pyx_r;
18872 }
18873 
18874 /* "View.MemoryView":1247
18875  *
18876  * @cname('__pyx_memoryview_err_extents')
18877  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18878  * Py_ssize_t extent2) except -1 with gil:
18879  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18880  */
18881 
18882 static int __pyx_memoryview_err_extents(int __pyx_v_i, Py_ssize_t __pyx_v_extent1, Py_ssize_t __pyx_v_extent2) {
18883  int __pyx_r;
18884  __Pyx_RefNannyDeclarations
18885  PyObject *__pyx_t_1 = NULL;
18886  PyObject *__pyx_t_2 = NULL;
18887  PyObject *__pyx_t_3 = NULL;
18888  PyObject *__pyx_t_4 = NULL;
18889  #ifdef WITH_THREAD
18890  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18891  #endif
18892  __Pyx_RefNannySetupContext("_err_extents", 0);
18893 
18894  /* "View.MemoryView":1250
18895  * Py_ssize_t extent2) except -1 with gil:
18896  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18897  * (i, extent1, extent2)) # <<<<<<<<<<<<<<
18898  *
18899  * @cname('__pyx_memoryview_err_dim')
18900  */
18901  __pyx_t_1 = __Pyx_PyInt_From_int(__pyx_v_i); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1250, __pyx_L1_error)
18902  __Pyx_GOTREF(__pyx_t_1);
18903  __pyx_t_2 = PyInt_FromSsize_t(__pyx_v_extent1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1250, __pyx_L1_error)
18904  __Pyx_GOTREF(__pyx_t_2);
18905  __pyx_t_3 = PyInt_FromSsize_t(__pyx_v_extent2); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1250, __pyx_L1_error)
18906  __Pyx_GOTREF(__pyx_t_3);
18907  __pyx_t_4 = PyTuple_New(3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1250, __pyx_L1_error)
18908  __Pyx_GOTREF(__pyx_t_4);
18909  __Pyx_GIVEREF(__pyx_t_1);
18910  PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_1);
18911  __Pyx_GIVEREF(__pyx_t_2);
18912  PyTuple_SET_ITEM(__pyx_t_4, 1, __pyx_t_2);
18913  __Pyx_GIVEREF(__pyx_t_3);
18914  PyTuple_SET_ITEM(__pyx_t_4, 2, __pyx_t_3);
18915  __pyx_t_1 = 0;
18916  __pyx_t_2 = 0;
18917  __pyx_t_3 = 0;
18918 
18919  /* "View.MemoryView":1249
18920  * cdef int _err_extents(int i, Py_ssize_t extent1,
18921  * Py_ssize_t extent2) except -1 with gil:
18922  * raise ValueError("got differing extents in dimension %d (got %d and %d)" % # <<<<<<<<<<<<<<
18923  * (i, extent1, extent2))
18924  *
18925  */
18926  __pyx_t_3 = __Pyx_PyString_Format(__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1249, __pyx_L1_error)
18927  __Pyx_GOTREF(__pyx_t_3);
18928  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18929  __pyx_t_4 = __Pyx_PyObject_CallOneArg(__pyx_builtin_ValueError, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1249, __pyx_L1_error)
18930  __Pyx_GOTREF(__pyx_t_4);
18931  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18932  __Pyx_Raise(__pyx_t_4, 0, 0, 0);
18933  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
18934  __PYX_ERR(0, 1249, __pyx_L1_error)
18935 
18936  /* "View.MemoryView":1247
18937  *
18938  * @cname('__pyx_memoryview_err_extents')
18939  * cdef int _err_extents(int i, Py_ssize_t extent1, # <<<<<<<<<<<<<<
18940  * Py_ssize_t extent2) except -1 with gil:
18941  * raise ValueError("got differing extents in dimension %d (got %d and %d)" %
18942  */
18943 
18944  /* function exit code */
18945  __pyx_L1_error:;
18946  __Pyx_XDECREF(__pyx_t_1);
18947  __Pyx_XDECREF(__pyx_t_2);
18948  __Pyx_XDECREF(__pyx_t_3);
18949  __Pyx_XDECREF(__pyx_t_4);
18950  __Pyx_AddTraceback("View.MemoryView._err_extents", __pyx_clineno, __pyx_lineno, __pyx_filename);
18951  __pyx_r = -1;
18952  __Pyx_RefNannyFinishContext();
18953  #ifdef WITH_THREAD
18954  __Pyx_PyGILState_Release(__pyx_gilstate_save);
18955  #endif
18956  return __pyx_r;
18957 }
18958 
18959 /* "View.MemoryView":1253
18960  *
18961  * @cname('__pyx_memoryview_err_dim')
18962  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
18963  * raise error(msg.decode('ascii') % dim)
18964  *
18965  */
18966 
18967 static int __pyx_memoryview_err_dim(PyObject *__pyx_v_error, char *__pyx_v_msg, int __pyx_v_dim) {
18968  int __pyx_r;
18969  __Pyx_RefNannyDeclarations
18970  PyObject *__pyx_t_1 = NULL;
18971  PyObject *__pyx_t_2 = NULL;
18972  PyObject *__pyx_t_3 = NULL;
18973  PyObject *__pyx_t_4 = NULL;
18974  PyObject *__pyx_t_5 = NULL;
18975  #ifdef WITH_THREAD
18976  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
18977  #endif
18978  __Pyx_RefNannySetupContext("_err_dim", 0);
18979  __Pyx_INCREF(__pyx_v_error);
18980 
18981  /* "View.MemoryView":1254
18982  * @cname('__pyx_memoryview_err_dim')
18983  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil:
18984  * raise error(msg.decode('ascii') % dim) # <<<<<<<<<<<<<<
18985  *
18986  * @cname('__pyx_memoryview_err')
18987  */
18988  __pyx_t_2 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1254, __pyx_L1_error)
18989  __Pyx_GOTREF(__pyx_t_2);
18990  __pyx_t_3 = __Pyx_PyInt_From_int(__pyx_v_dim); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1254, __pyx_L1_error)
18991  __Pyx_GOTREF(__pyx_t_3);
18992  __pyx_t_4 = PyUnicode_Format(__pyx_t_2, __pyx_t_3); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 1254, __pyx_L1_error)
18993  __Pyx_GOTREF(__pyx_t_4);
18994  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
18995  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
18996  __Pyx_INCREF(__pyx_v_error);
18997  __pyx_t_3 = __pyx_v_error; __pyx_t_2 = NULL;
18998  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_3))) {
18999  __pyx_t_2 = PyMethod_GET_SELF(__pyx_t_3);
19000  if (likely(__pyx_t_2)) {
19001  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_3);
19002  __Pyx_INCREF(__pyx_t_2);
19003  __Pyx_INCREF(function);
19004  __Pyx_DECREF_SET(__pyx_t_3, function);
19005  }
19006  }
19007  if (!__pyx_t_2) {
19008  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_3, __pyx_t_4); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
19009  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19010  __Pyx_GOTREF(__pyx_t_1);
19011  } else {
19012  #if CYTHON_FAST_PYCALL
19013  if (PyFunction_Check(__pyx_t_3)) {
19014  PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19015  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
19016  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19017  __Pyx_GOTREF(__pyx_t_1);
19018  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19019  } else
19020  #endif
19021  #if CYTHON_FAST_PYCCALL
19022  if (__Pyx_PyFastCFunction_Check(__pyx_t_3)) {
19023  PyObject *__pyx_temp[2] = {__pyx_t_2, __pyx_t_4};
19024  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_3, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
19025  __Pyx_XDECREF(__pyx_t_2); __pyx_t_2 = 0;
19026  __Pyx_GOTREF(__pyx_t_1);
19027  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19028  } else
19029  #endif
19030  {
19031  __pyx_t_5 = PyTuple_New(1+1); if (unlikely(!__pyx_t_5)) __PYX_ERR(0, 1254, __pyx_L1_error)
19032  __Pyx_GOTREF(__pyx_t_5);
19033  __Pyx_GIVEREF(__pyx_t_2); PyTuple_SET_ITEM(__pyx_t_5, 0, __pyx_t_2); __pyx_t_2 = NULL;
19034  __Pyx_GIVEREF(__pyx_t_4);
19035  PyTuple_SET_ITEM(__pyx_t_5, 0+1, __pyx_t_4);
19036  __pyx_t_4 = 0;
19037  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_3, __pyx_t_5, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1254, __pyx_L1_error)
19038  __Pyx_GOTREF(__pyx_t_1);
19039  __Pyx_DECREF(__pyx_t_5); __pyx_t_5 = 0;
19040  }
19041  }
19042  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19043  __Pyx_Raise(__pyx_t_1, 0, 0, 0);
19044  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
19045  __PYX_ERR(0, 1254, __pyx_L1_error)
19046 
19047  /* "View.MemoryView":1253
19048  *
19049  * @cname('__pyx_memoryview_err_dim')
19050  * cdef int _err_dim(object error, char *msg, int dim) except -1 with gil: # <<<<<<<<<<<<<<
19051  * raise error(msg.decode('ascii') % dim)
19052  *
19053  */
19054 
19055  /* function exit code */
19056  __pyx_L1_error:;
19057  __Pyx_XDECREF(__pyx_t_1);
19058  __Pyx_XDECREF(__pyx_t_2);
19059  __Pyx_XDECREF(__pyx_t_3);
19060  __Pyx_XDECREF(__pyx_t_4);
19061  __Pyx_XDECREF(__pyx_t_5);
19062  __Pyx_AddTraceback("View.MemoryView._err_dim", __pyx_clineno, __pyx_lineno, __pyx_filename);
19063  __pyx_r = -1;
19064  __Pyx_XDECREF(__pyx_v_error);
19065  __Pyx_RefNannyFinishContext();
19066  #ifdef WITH_THREAD
19067  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19068  #endif
19069  return __pyx_r;
19070 }
19071 
19072 /* "View.MemoryView":1257
19073  *
19074  * @cname('__pyx_memoryview_err')
19075  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19076  * if msg != NULL:
19077  * raise error(msg.decode('ascii'))
19078  */
19079 
19080 static int __pyx_memoryview_err(PyObject *__pyx_v_error, char *__pyx_v_msg) {
19081  int __pyx_r;
19082  __Pyx_RefNannyDeclarations
19083  int __pyx_t_1;
19084  PyObject *__pyx_t_2 = NULL;
19085  PyObject *__pyx_t_3 = NULL;
19086  PyObject *__pyx_t_4 = NULL;
19087  PyObject *__pyx_t_5 = NULL;
19088  PyObject *__pyx_t_6 = NULL;
19089  #ifdef WITH_THREAD
19090  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19091  #endif
19092  __Pyx_RefNannySetupContext("_err", 0);
19093  __Pyx_INCREF(__pyx_v_error);
19094 
19095  /* "View.MemoryView":1258
19096  * @cname('__pyx_memoryview_err')
19097  * cdef int _err(object error, char *msg) except -1 with gil:
19098  * if msg != NULL: # <<<<<<<<<<<<<<
19099  * raise error(msg.decode('ascii'))
19100  * else:
19101  */
19102  __pyx_t_1 = ((__pyx_v_msg != NULL) != 0);
19103  if (unlikely(__pyx_t_1)) {
19104 
19105  /* "View.MemoryView":1259
19106  * cdef int _err(object error, char *msg) except -1 with gil:
19107  * if msg != NULL:
19108  * raise error(msg.decode('ascii')) # <<<<<<<<<<<<<<
19109  * else:
19110  * raise error
19111  */
19112  __pyx_t_3 = __Pyx_decode_c_string(__pyx_v_msg, 0, strlen(__pyx_v_msg), NULL, NULL, PyUnicode_DecodeASCII); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 1259, __pyx_L1_error)
19113  __Pyx_GOTREF(__pyx_t_3);
19114  __Pyx_INCREF(__pyx_v_error);
19115  __pyx_t_4 = __pyx_v_error; __pyx_t_5 = NULL;
19116  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_4))) {
19117  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_4);
19118  if (likely(__pyx_t_5)) {
19119  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_4);
19120  __Pyx_INCREF(__pyx_t_5);
19121  __Pyx_INCREF(function);
19122  __Pyx_DECREF_SET(__pyx_t_4, function);
19123  }
19124  }
19125  if (!__pyx_t_5) {
19126  __pyx_t_2 = __Pyx_PyObject_CallOneArg(__pyx_t_4, __pyx_t_3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
19127  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19128  __Pyx_GOTREF(__pyx_t_2);
19129  } else {
19130  #if CYTHON_FAST_PYCALL
19131  if (PyFunction_Check(__pyx_t_4)) {
19132  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19133  __pyx_t_2 = __Pyx_PyFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
19134  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19135  __Pyx_GOTREF(__pyx_t_2);
19136  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19137  } else
19138  #endif
19139  #if CYTHON_FAST_PYCCALL
19140  if (__Pyx_PyFastCFunction_Check(__pyx_t_4)) {
19141  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_3};
19142  __pyx_t_2 = __Pyx_PyCFunction_FastCall(__pyx_t_4, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
19143  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
19144  __Pyx_GOTREF(__pyx_t_2);
19145  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
19146  } else
19147  #endif
19148  {
19149  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 1259, __pyx_L1_error)
19150  __Pyx_GOTREF(__pyx_t_6);
19151  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
19152  __Pyx_GIVEREF(__pyx_t_3);
19153  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_3);
19154  __pyx_t_3 = 0;
19155  __pyx_t_2 = __Pyx_PyObject_Call(__pyx_t_4, __pyx_t_6, NULL); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 1259, __pyx_L1_error)
19156  __Pyx_GOTREF(__pyx_t_2);
19157  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
19158  }
19159  }
19160  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
19161  __Pyx_Raise(__pyx_t_2, 0, 0, 0);
19162  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
19163  __PYX_ERR(0, 1259, __pyx_L1_error)
19164 
19165  /* "View.MemoryView":1258
19166  * @cname('__pyx_memoryview_err')
19167  * cdef int _err(object error, char *msg) except -1 with gil:
19168  * if msg != NULL: # <<<<<<<<<<<<<<
19169  * raise error(msg.decode('ascii'))
19170  * else:
19171  */
19172  }
19173 
19174  /* "View.MemoryView":1261
19175  * raise error(msg.decode('ascii'))
19176  * else:
19177  * raise error # <<<<<<<<<<<<<<
19178  *
19179  * @cname('__pyx_memoryview_copy_contents')
19180  */
19181  /*else*/ {
19182  __Pyx_Raise(__pyx_v_error, 0, 0, 0);
19183  __PYX_ERR(0, 1261, __pyx_L1_error)
19184  }
19185 
19186  /* "View.MemoryView":1257
19187  *
19188  * @cname('__pyx_memoryview_err')
19189  * cdef int _err(object error, char *msg) except -1 with gil: # <<<<<<<<<<<<<<
19190  * if msg != NULL:
19191  * raise error(msg.decode('ascii'))
19192  */
19193 
19194  /* function exit code */
19195  __pyx_L1_error:;
19196  __Pyx_XDECREF(__pyx_t_2);
19197  __Pyx_XDECREF(__pyx_t_3);
19198  __Pyx_XDECREF(__pyx_t_4);
19199  __Pyx_XDECREF(__pyx_t_5);
19200  __Pyx_XDECREF(__pyx_t_6);
19201  __Pyx_AddTraceback("View.MemoryView._err", __pyx_clineno, __pyx_lineno, __pyx_filename);
19202  __pyx_r = -1;
19203  __Pyx_XDECREF(__pyx_v_error);
19204  __Pyx_RefNannyFinishContext();
19205  #ifdef WITH_THREAD
19206  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19207  #endif
19208  return __pyx_r;
19209 }
19210 
19211 /* "View.MemoryView":1264
19212  *
19213  * @cname('__pyx_memoryview_copy_contents')
19214  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19215  * __Pyx_memviewslice dst,
19216  * int src_ndim, int dst_ndim,
19217  */
19218 
19219 static int __pyx_memoryview_copy_contents(__Pyx_memviewslice __pyx_v_src, __Pyx_memviewslice __pyx_v_dst, int __pyx_v_src_ndim, int __pyx_v_dst_ndim, int __pyx_v_dtype_is_object) {
19220  void *__pyx_v_tmpdata;
19221  size_t __pyx_v_itemsize;
19222  int __pyx_v_i;
19223  char __pyx_v_order;
19224  int __pyx_v_broadcasting;
19225  int __pyx_v_direct_copy;
19226  __Pyx_memviewslice __pyx_v_tmp;
19227  int __pyx_v_ndim;
19228  int __pyx_r;
19229  Py_ssize_t __pyx_t_1;
19230  int __pyx_t_2;
19231  int __pyx_t_3;
19232  int __pyx_t_4;
19233  int __pyx_t_5;
19234  int __pyx_t_6;
19235  void *__pyx_t_7;
19236  int __pyx_t_8;
19237 
19238  /* "View.MemoryView":1272
19239  * Check for overlapping memory and verify the shapes.
19240  * """
19241  * cdef void *tmpdata = NULL # <<<<<<<<<<<<<<
19242  * cdef size_t itemsize = src.memview.view.itemsize
19243  * cdef int i
19244  */
19245  __pyx_v_tmpdata = NULL;
19246 
19247  /* "View.MemoryView":1273
19248  * """
19249  * cdef void *tmpdata = NULL
19250  * cdef size_t itemsize = src.memview.view.itemsize # <<<<<<<<<<<<<<
19251  * cdef int i
19252  * cdef char order = get_best_order(&src, src_ndim)
19253  */
19254  __pyx_t_1 = __pyx_v_src.memview->view.itemsize;
19255  __pyx_v_itemsize = __pyx_t_1;
19256 
19257  /* "View.MemoryView":1275
19258  * cdef size_t itemsize = src.memview.view.itemsize
19259  * cdef int i
19260  * cdef char order = get_best_order(&src, src_ndim) # <<<<<<<<<<<<<<
19261  * cdef bint broadcasting = False
19262  * cdef bint direct_copy = False
19263  */
19264  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_src), __pyx_v_src_ndim);
19265 
19266  /* "View.MemoryView":1276
19267  * cdef int i
19268  * cdef char order = get_best_order(&src, src_ndim)
19269  * cdef bint broadcasting = False # <<<<<<<<<<<<<<
19270  * cdef bint direct_copy = False
19271  * cdef __Pyx_memviewslice tmp
19272  */
19273  __pyx_v_broadcasting = 0;
19274 
19275  /* "View.MemoryView":1277
19276  * cdef char order = get_best_order(&src, src_ndim)
19277  * cdef bint broadcasting = False
19278  * cdef bint direct_copy = False # <<<<<<<<<<<<<<
19279  * cdef __Pyx_memviewslice tmp
19280  *
19281  */
19282  __pyx_v_direct_copy = 0;
19283 
19284  /* "View.MemoryView":1280
19285  * cdef __Pyx_memviewslice tmp
19286  *
19287  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19288  * broadcast_leading(&src, src_ndim, dst_ndim)
19289  * elif dst_ndim < src_ndim:
19290  */
19291  __pyx_t_2 = ((__pyx_v_src_ndim < __pyx_v_dst_ndim) != 0);
19292  if (__pyx_t_2) {
19293 
19294  /* "View.MemoryView":1281
19295  *
19296  * if src_ndim < dst_ndim:
19297  * broadcast_leading(&src, src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19298  * elif dst_ndim < src_ndim:
19299  * broadcast_leading(&dst, dst_ndim, src_ndim)
19300  */
19301  __pyx_memoryview_broadcast_leading((&__pyx_v_src), __pyx_v_src_ndim, __pyx_v_dst_ndim);
19302 
19303  /* "View.MemoryView":1280
19304  * cdef __Pyx_memviewslice tmp
19305  *
19306  * if src_ndim < dst_ndim: # <<<<<<<<<<<<<<
19307  * broadcast_leading(&src, src_ndim, dst_ndim)
19308  * elif dst_ndim < src_ndim:
19309  */
19310  goto __pyx_L3;
19311  }
19312 
19313  /* "View.MemoryView":1282
19314  * if src_ndim < dst_ndim:
19315  * broadcast_leading(&src, src_ndim, dst_ndim)
19316  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19317  * broadcast_leading(&dst, dst_ndim, src_ndim)
19318  *
19319  */
19320  __pyx_t_2 = ((__pyx_v_dst_ndim < __pyx_v_src_ndim) != 0);
19321  if (__pyx_t_2) {
19322 
19323  /* "View.MemoryView":1283
19324  * broadcast_leading(&src, src_ndim, dst_ndim)
19325  * elif dst_ndim < src_ndim:
19326  * broadcast_leading(&dst, dst_ndim, src_ndim) # <<<<<<<<<<<<<<
19327  *
19328  * cdef int ndim = max(src_ndim, dst_ndim)
19329  */
19330  __pyx_memoryview_broadcast_leading((&__pyx_v_dst), __pyx_v_dst_ndim, __pyx_v_src_ndim);
19331 
19332  /* "View.MemoryView":1282
19333  * if src_ndim < dst_ndim:
19334  * broadcast_leading(&src, src_ndim, dst_ndim)
19335  * elif dst_ndim < src_ndim: # <<<<<<<<<<<<<<
19336  * broadcast_leading(&dst, dst_ndim, src_ndim)
19337  *
19338  */
19339  }
19340  __pyx_L3:;
19341 
19342  /* "View.MemoryView":1285
19343  * broadcast_leading(&dst, dst_ndim, src_ndim)
19344  *
19345  * cdef int ndim = max(src_ndim, dst_ndim) # <<<<<<<<<<<<<<
19346  *
19347  * for i in range(ndim):
19348  */
19349  __pyx_t_3 = __pyx_v_dst_ndim;
19350  __pyx_t_4 = __pyx_v_src_ndim;
19351  if (((__pyx_t_3 > __pyx_t_4) != 0)) {
19352  __pyx_t_5 = __pyx_t_3;
19353  } else {
19354  __pyx_t_5 = __pyx_t_4;
19355  }
19356  __pyx_v_ndim = __pyx_t_5;
19357 
19358  /* "View.MemoryView":1287
19359  * cdef int ndim = max(src_ndim, dst_ndim)
19360  *
19361  * for i in range(ndim): # <<<<<<<<<<<<<<
19362  * if src.shape[i] != dst.shape[i]:
19363  * if src.shape[i] == 1:
19364  */
19365  __pyx_t_5 = __pyx_v_ndim;
19366  __pyx_t_3 = __pyx_t_5;
19367  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
19368  __pyx_v_i = __pyx_t_4;
19369 
19370  /* "View.MemoryView":1288
19371  *
19372  * for i in range(ndim):
19373  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19374  * if src.shape[i] == 1:
19375  * broadcasting = True
19376  */
19377  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) != (__pyx_v_dst.shape[__pyx_v_i])) != 0);
19378  if (__pyx_t_2) {
19379 
19380  /* "View.MemoryView":1289
19381  * for i in range(ndim):
19382  * if src.shape[i] != dst.shape[i]:
19383  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19384  * broadcasting = True
19385  * src.strides[i] = 0
19386  */
19387  __pyx_t_2 = (((__pyx_v_src.shape[__pyx_v_i]) == 1) != 0);
19388  if (__pyx_t_2) {
19389 
19390  /* "View.MemoryView":1290
19391  * if src.shape[i] != dst.shape[i]:
19392  * if src.shape[i] == 1:
19393  * broadcasting = True # <<<<<<<<<<<<<<
19394  * src.strides[i] = 0
19395  * else:
19396  */
19397  __pyx_v_broadcasting = 1;
19398 
19399  /* "View.MemoryView":1291
19400  * if src.shape[i] == 1:
19401  * broadcasting = True
19402  * src.strides[i] = 0 # <<<<<<<<<<<<<<
19403  * else:
19404  * _err_extents(i, dst.shape[i], src.shape[i])
19405  */
19406  (__pyx_v_src.strides[__pyx_v_i]) = 0;
19407 
19408  /* "View.MemoryView":1289
19409  * for i in range(ndim):
19410  * if src.shape[i] != dst.shape[i]:
19411  * if src.shape[i] == 1: # <<<<<<<<<<<<<<
19412  * broadcasting = True
19413  * src.strides[i] = 0
19414  */
19415  goto __pyx_L7;
19416  }
19417 
19418  /* "View.MemoryView":1293
19419  * src.strides[i] = 0
19420  * else:
19421  * _err_extents(i, dst.shape[i], src.shape[i]) # <<<<<<<<<<<<<<
19422  *
19423  * if src.suboffsets[i] >= 0:
19424  */
19425  /*else*/ {
19426  __pyx_t_6 = __pyx_memoryview_err_extents(__pyx_v_i, (__pyx_v_dst.shape[__pyx_v_i]), (__pyx_v_src.shape[__pyx_v_i])); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1293, __pyx_L1_error)
19427  }
19428  __pyx_L7:;
19429 
19430  /* "View.MemoryView":1288
19431  *
19432  * for i in range(ndim):
19433  * if src.shape[i] != dst.shape[i]: # <<<<<<<<<<<<<<
19434  * if src.shape[i] == 1:
19435  * broadcasting = True
19436  */
19437  }
19438 
19439  /* "View.MemoryView":1295
19440  * _err_extents(i, dst.shape[i], src.shape[i])
19441  *
19442  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19443  * _err_dim(ValueError, "Dimension %d is not direct", i)
19444  *
19445  */
19446  __pyx_t_2 = (((__pyx_v_src.suboffsets[__pyx_v_i]) >= 0) != 0);
19447  if (__pyx_t_2) {
19448 
19449  /* "View.MemoryView":1296
19450  *
19451  * if src.suboffsets[i] >= 0:
19452  * _err_dim(ValueError, "Dimension %d is not direct", i) # <<<<<<<<<<<<<<
19453  *
19454  * if slices_overlap(&src, &dst, ndim, itemsize):
19455  */
19456  __pyx_t_6 = __pyx_memoryview_err_dim(__pyx_builtin_ValueError, ((char *)"Dimension %d is not direct"), __pyx_v_i); if (unlikely(__pyx_t_6 == ((int)-1))) __PYX_ERR(0, 1296, __pyx_L1_error)
19457 
19458  /* "View.MemoryView":1295
19459  * _err_extents(i, dst.shape[i], src.shape[i])
19460  *
19461  * if src.suboffsets[i] >= 0: # <<<<<<<<<<<<<<
19462  * _err_dim(ValueError, "Dimension %d is not direct", i)
19463  *
19464  */
19465  }
19466  }
19467 
19468  /* "View.MemoryView":1298
19469  * _err_dim(ValueError, "Dimension %d is not direct", i)
19470  *
19471  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19472  *
19473  * if not slice_is_contig(src, order, ndim):
19474  */
19475  __pyx_t_2 = (__pyx_slices_overlap((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize) != 0);
19476  if (__pyx_t_2) {
19477 
19478  /* "View.MemoryView":1300
19479  * if slices_overlap(&src, &dst, ndim, itemsize):
19480  *
19481  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19482  * order = get_best_order(&dst, ndim)
19483  *
19484  */
19485  __pyx_t_2 = ((!(__pyx_memviewslice_is_contig(__pyx_v_src, __pyx_v_order, __pyx_v_ndim) != 0)) != 0);
19486  if (__pyx_t_2) {
19487 
19488  /* "View.MemoryView":1301
19489  *
19490  * if not slice_is_contig(src, order, ndim):
19491  * order = get_best_order(&dst, ndim) # <<<<<<<<<<<<<<
19492  *
19493  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19494  */
19495  __pyx_v_order = __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim);
19496 
19497  /* "View.MemoryView":1300
19498  * if slices_overlap(&src, &dst, ndim, itemsize):
19499  *
19500  * if not slice_is_contig(src, order, ndim): # <<<<<<<<<<<<<<
19501  * order = get_best_order(&dst, ndim)
19502  *
19503  */
19504  }
19505 
19506  /* "View.MemoryView":1303
19507  * order = get_best_order(&dst, ndim)
19508  *
19509  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim) # <<<<<<<<<<<<<<
19510  * src = tmp
19511  *
19512  */
19513  __pyx_t_7 = __pyx_memoryview_copy_data_to_temp((&__pyx_v_src), (&__pyx_v_tmp), __pyx_v_order, __pyx_v_ndim); if (unlikely(__pyx_t_7 == ((void *)NULL))) __PYX_ERR(0, 1303, __pyx_L1_error)
19514  __pyx_v_tmpdata = __pyx_t_7;
19515 
19516  /* "View.MemoryView":1304
19517  *
19518  * tmpdata = copy_data_to_temp(&src, &tmp, order, ndim)
19519  * src = tmp # <<<<<<<<<<<<<<
19520  *
19521  * if not broadcasting:
19522  */
19523  __pyx_v_src = __pyx_v_tmp;
19524 
19525  /* "View.MemoryView":1298
19526  * _err_dim(ValueError, "Dimension %d is not direct", i)
19527  *
19528  * if slices_overlap(&src, &dst, ndim, itemsize): # <<<<<<<<<<<<<<
19529  *
19530  * if not slice_is_contig(src, order, ndim):
19531  */
19532  }
19533 
19534  /* "View.MemoryView":1306
19535  * src = tmp
19536  *
19537  * if not broadcasting: # <<<<<<<<<<<<<<
19538  *
19539  *
19540  */
19541  __pyx_t_2 = ((!(__pyx_v_broadcasting != 0)) != 0);
19542  if (__pyx_t_2) {
19543 
19544  /* "View.MemoryView":1309
19545  *
19546  *
19547  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19548  * direct_copy = slice_is_contig(dst, 'C', ndim)
19549  * elif slice_is_contig(src, 'F', ndim):
19550  */
19551  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'C', __pyx_v_ndim) != 0);
19552  if (__pyx_t_2) {
19553 
19554  /* "View.MemoryView":1310
19555  *
19556  * if slice_is_contig(src, 'C', ndim):
19557  * direct_copy = slice_is_contig(dst, 'C', ndim) # <<<<<<<<<<<<<<
19558  * elif slice_is_contig(src, 'F', ndim):
19559  * direct_copy = slice_is_contig(dst, 'F', ndim)
19560  */
19561  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'C', __pyx_v_ndim);
19562 
19563  /* "View.MemoryView":1309
19564  *
19565  *
19566  * if slice_is_contig(src, 'C', ndim): # <<<<<<<<<<<<<<
19567  * direct_copy = slice_is_contig(dst, 'C', ndim)
19568  * elif slice_is_contig(src, 'F', ndim):
19569  */
19570  goto __pyx_L12;
19571  }
19572 
19573  /* "View.MemoryView":1311
19574  * if slice_is_contig(src, 'C', ndim):
19575  * direct_copy = slice_is_contig(dst, 'C', ndim)
19576  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19577  * direct_copy = slice_is_contig(dst, 'F', ndim)
19578  *
19579  */
19580  __pyx_t_2 = (__pyx_memviewslice_is_contig(__pyx_v_src, 'F', __pyx_v_ndim) != 0);
19581  if (__pyx_t_2) {
19582 
19583  /* "View.MemoryView":1312
19584  * direct_copy = slice_is_contig(dst, 'C', ndim)
19585  * elif slice_is_contig(src, 'F', ndim):
19586  * direct_copy = slice_is_contig(dst, 'F', ndim) # <<<<<<<<<<<<<<
19587  *
19588  * if direct_copy:
19589  */
19590  __pyx_v_direct_copy = __pyx_memviewslice_is_contig(__pyx_v_dst, 'F', __pyx_v_ndim);
19591 
19592  /* "View.MemoryView":1311
19593  * if slice_is_contig(src, 'C', ndim):
19594  * direct_copy = slice_is_contig(dst, 'C', ndim)
19595  * elif slice_is_contig(src, 'F', ndim): # <<<<<<<<<<<<<<
19596  * direct_copy = slice_is_contig(dst, 'F', ndim)
19597  *
19598  */
19599  }
19600  __pyx_L12:;
19601 
19602  /* "View.MemoryView":1314
19603  * direct_copy = slice_is_contig(dst, 'F', ndim)
19604  *
19605  * if direct_copy: # <<<<<<<<<<<<<<
19606  *
19607  * refcount_copying(&dst, dtype_is_object, ndim, False)
19608  */
19609  __pyx_t_2 = (__pyx_v_direct_copy != 0);
19610  if (__pyx_t_2) {
19611 
19612  /* "View.MemoryView":1316
19613  * if direct_copy:
19614  *
19615  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19616  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19617  * refcount_copying(&dst, dtype_is_object, ndim, True)
19618  */
19619  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19620 
19621  /* "View.MemoryView":1317
19622  *
19623  * refcount_copying(&dst, dtype_is_object, ndim, False)
19624  * memcpy(dst.data, src.data, slice_get_size(&src, ndim)) # <<<<<<<<<<<<<<
19625  * refcount_copying(&dst, dtype_is_object, ndim, True)
19626  * free(tmpdata)
19627  */
19628  (void)(memcpy(__pyx_v_dst.data, __pyx_v_src.data, __pyx_memoryview_slice_get_size((&__pyx_v_src), __pyx_v_ndim)));
19629 
19630  /* "View.MemoryView":1318
19631  * refcount_copying(&dst, dtype_is_object, ndim, False)
19632  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19633  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19634  * free(tmpdata)
19635  * return 0
19636  */
19637  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19638 
19639  /* "View.MemoryView":1319
19640  * memcpy(dst.data, src.data, slice_get_size(&src, ndim))
19641  * refcount_copying(&dst, dtype_is_object, ndim, True)
19642  * free(tmpdata) # <<<<<<<<<<<<<<
19643  * return 0
19644  *
19645  */
19646  free(__pyx_v_tmpdata);
19647 
19648  /* "View.MemoryView":1320
19649  * refcount_copying(&dst, dtype_is_object, ndim, True)
19650  * free(tmpdata)
19651  * return 0 # <<<<<<<<<<<<<<
19652  *
19653  * if order == 'F' == get_best_order(&dst, ndim):
19654  */
19655  __pyx_r = 0;
19656  goto __pyx_L0;
19657 
19658  /* "View.MemoryView":1314
19659  * direct_copy = slice_is_contig(dst, 'F', ndim)
19660  *
19661  * if direct_copy: # <<<<<<<<<<<<<<
19662  *
19663  * refcount_copying(&dst, dtype_is_object, ndim, False)
19664  */
19665  }
19666 
19667  /* "View.MemoryView":1306
19668  * src = tmp
19669  *
19670  * if not broadcasting: # <<<<<<<<<<<<<<
19671  *
19672  *
19673  */
19674  }
19675 
19676  /* "View.MemoryView":1322
19677  * return 0
19678  *
19679  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19680  *
19681  *
19682  */
19683  __pyx_t_2 = (__pyx_v_order == 'F');
19684  if (__pyx_t_2) {
19685  __pyx_t_2 = ('F' == __pyx_get_best_slice_order((&__pyx_v_dst), __pyx_v_ndim));
19686  }
19687  __pyx_t_8 = (__pyx_t_2 != 0);
19688  if (__pyx_t_8) {
19689 
19690  /* "View.MemoryView":1325
19691  *
19692  *
19693  * transpose_memslice(&src) # <<<<<<<<<<<<<<
19694  * transpose_memslice(&dst)
19695  *
19696  */
19697  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_src)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(0, 1325, __pyx_L1_error)
19698 
19699  /* "View.MemoryView":1326
19700  *
19701  * transpose_memslice(&src)
19702  * transpose_memslice(&dst) # <<<<<<<<<<<<<<
19703  *
19704  * refcount_copying(&dst, dtype_is_object, ndim, False)
19705  */
19706  __pyx_t_5 = __pyx_memslice_transpose((&__pyx_v_dst)); if (unlikely(__pyx_t_5 == ((int)0))) __PYX_ERR(0, 1326, __pyx_L1_error)
19707 
19708  /* "View.MemoryView":1322
19709  * return 0
19710  *
19711  * if order == 'F' == get_best_order(&dst, ndim): # <<<<<<<<<<<<<<
19712  *
19713  *
19714  */
19715  }
19716 
19717  /* "View.MemoryView":1328
19718  * transpose_memslice(&dst)
19719  *
19720  * refcount_copying(&dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
19721  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19722  * refcount_copying(&dst, dtype_is_object, ndim, True)
19723  */
19724  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
19725 
19726  /* "View.MemoryView":1329
19727  *
19728  * refcount_copying(&dst, dtype_is_object, ndim, False)
19729  * copy_strided_to_strided(&src, &dst, ndim, itemsize) # <<<<<<<<<<<<<<
19730  * refcount_copying(&dst, dtype_is_object, ndim, True)
19731  *
19732  */
19733  copy_strided_to_strided((&__pyx_v_src), (&__pyx_v_dst), __pyx_v_ndim, __pyx_v_itemsize);
19734 
19735  /* "View.MemoryView":1330
19736  * refcount_copying(&dst, dtype_is_object, ndim, False)
19737  * copy_strided_to_strided(&src, &dst, ndim, itemsize)
19738  * refcount_copying(&dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
19739  *
19740  * free(tmpdata)
19741  */
19742  __pyx_memoryview_refcount_copying((&__pyx_v_dst), __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
19743 
19744  /* "View.MemoryView":1332
19745  * refcount_copying(&dst, dtype_is_object, ndim, True)
19746  *
19747  * free(tmpdata) # <<<<<<<<<<<<<<
19748  * return 0
19749  *
19750  */
19751  free(__pyx_v_tmpdata);
19752 
19753  /* "View.MemoryView":1333
19754  *
19755  * free(tmpdata)
19756  * return 0 # <<<<<<<<<<<<<<
19757  *
19758  * @cname('__pyx_memoryview_broadcast_leading')
19759  */
19760  __pyx_r = 0;
19761  goto __pyx_L0;
19762 
19763  /* "View.MemoryView":1264
19764  *
19765  * @cname('__pyx_memoryview_copy_contents')
19766  * cdef int memoryview_copy_contents(__Pyx_memviewslice src, # <<<<<<<<<<<<<<
19767  * __Pyx_memviewslice dst,
19768  * int src_ndim, int dst_ndim,
19769  */
19770 
19771  /* function exit code */
19772  __pyx_L1_error:;
19773  {
19774  #ifdef WITH_THREAD
19775  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19776  #endif
19777  __Pyx_AddTraceback("View.MemoryView.memoryview_copy_contents", __pyx_clineno, __pyx_lineno, __pyx_filename);
19778  #ifdef WITH_THREAD
19779  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19780  #endif
19781  }
19782  __pyx_r = -1;
19783  __pyx_L0:;
19784  return __pyx_r;
19785 }
19786 
19787 /* "View.MemoryView":1336
19788  *
19789  * @cname('__pyx_memoryview_broadcast_leading')
19790  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19791  * int ndim,
19792  * int ndim_other) nogil:
19793  */
19794 
19795 static void __pyx_memoryview_broadcast_leading(__Pyx_memviewslice *__pyx_v_mslice, int __pyx_v_ndim, int __pyx_v_ndim_other) {
19796  int __pyx_v_i;
19797  int __pyx_v_offset;
19798  int __pyx_t_1;
19799  int __pyx_t_2;
19800  int __pyx_t_3;
19801 
19802  /* "View.MemoryView":1340
19803  * int ndim_other) nogil:
19804  * cdef int i
19805  * cdef int offset = ndim_other - ndim # <<<<<<<<<<<<<<
19806  *
19807  * for i in range(ndim - 1, -1, -1):
19808  */
19809  __pyx_v_offset = (__pyx_v_ndim_other - __pyx_v_ndim);
19810 
19811  /* "View.MemoryView":1342
19812  * cdef int offset = ndim_other - ndim
19813  *
19814  * for i in range(ndim - 1, -1, -1): # <<<<<<<<<<<<<<
19815  * mslice.shape[i + offset] = mslice.shape[i]
19816  * mslice.strides[i + offset] = mslice.strides[i]
19817  */
19818  for (__pyx_t_1 = (__pyx_v_ndim - 1); __pyx_t_1 > -1; __pyx_t_1-=1) {
19819  __pyx_v_i = __pyx_t_1;
19820 
19821  /* "View.MemoryView":1343
19822  *
19823  * for i in range(ndim - 1, -1, -1):
19824  * mslice.shape[i + offset] = mslice.shape[i] # <<<<<<<<<<<<<<
19825  * mslice.strides[i + offset] = mslice.strides[i]
19826  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19827  */
19828  (__pyx_v_mslice->shape[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->shape[__pyx_v_i]);
19829 
19830  /* "View.MemoryView":1344
19831  * for i in range(ndim - 1, -1, -1):
19832  * mslice.shape[i + offset] = mslice.shape[i]
19833  * mslice.strides[i + offset] = mslice.strides[i] # <<<<<<<<<<<<<<
19834  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19835  *
19836  */
19837  (__pyx_v_mslice->strides[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->strides[__pyx_v_i]);
19838 
19839  /* "View.MemoryView":1345
19840  * mslice.shape[i + offset] = mslice.shape[i]
19841  * mslice.strides[i + offset] = mslice.strides[i]
19842  * mslice.suboffsets[i + offset] = mslice.suboffsets[i] # <<<<<<<<<<<<<<
19843  *
19844  * for i in range(offset):
19845  */
19846  (__pyx_v_mslice->suboffsets[(__pyx_v_i + __pyx_v_offset)]) = (__pyx_v_mslice->suboffsets[__pyx_v_i]);
19847  }
19848 
19849  /* "View.MemoryView":1347
19850  * mslice.suboffsets[i + offset] = mslice.suboffsets[i]
19851  *
19852  * for i in range(offset): # <<<<<<<<<<<<<<
19853  * mslice.shape[i] = 1
19854  * mslice.strides[i] = mslice.strides[0]
19855  */
19856  __pyx_t_1 = __pyx_v_offset;
19857  __pyx_t_2 = __pyx_t_1;
19858  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
19859  __pyx_v_i = __pyx_t_3;
19860 
19861  /* "View.MemoryView":1348
19862  *
19863  * for i in range(offset):
19864  * mslice.shape[i] = 1 # <<<<<<<<<<<<<<
19865  * mslice.strides[i] = mslice.strides[0]
19866  * mslice.suboffsets[i] = -1
19867  */
19868  (__pyx_v_mslice->shape[__pyx_v_i]) = 1;
19869 
19870  /* "View.MemoryView":1349
19871  * for i in range(offset):
19872  * mslice.shape[i] = 1
19873  * mslice.strides[i] = mslice.strides[0] # <<<<<<<<<<<<<<
19874  * mslice.suboffsets[i] = -1
19875  *
19876  */
19877  (__pyx_v_mslice->strides[__pyx_v_i]) = (__pyx_v_mslice->strides[0]);
19878 
19879  /* "View.MemoryView":1350
19880  * mslice.shape[i] = 1
19881  * mslice.strides[i] = mslice.strides[0]
19882  * mslice.suboffsets[i] = -1 # <<<<<<<<<<<<<<
19883  *
19884  *
19885  */
19886  (__pyx_v_mslice->suboffsets[__pyx_v_i]) = -1L;
19887  }
19888 
19889  /* "View.MemoryView":1336
19890  *
19891  * @cname('__pyx_memoryview_broadcast_leading')
19892  * cdef void broadcast_leading(__Pyx_memviewslice *mslice, # <<<<<<<<<<<<<<
19893  * int ndim,
19894  * int ndim_other) nogil:
19895  */
19896 
19897  /* function exit code */
19898 }
19899 
19900 /* "View.MemoryView":1358
19901  *
19902  * @cname('__pyx_memoryview_refcount_copying')
19903  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19904  * int ndim, bint inc) nogil:
19905  *
19906  */
19907 
19908 static void __pyx_memoryview_refcount_copying(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_dtype_is_object, int __pyx_v_ndim, int __pyx_v_inc) {
19909  int __pyx_t_1;
19910 
19911  /* "View.MemoryView":1362
19912  *
19913  *
19914  * if dtype_is_object: # <<<<<<<<<<<<<<
19915  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19916  * dst.strides, ndim, inc)
19917  */
19918  __pyx_t_1 = (__pyx_v_dtype_is_object != 0);
19919  if (__pyx_t_1) {
19920 
19921  /* "View.MemoryView":1363
19922  *
19923  * if dtype_is_object:
19924  * refcount_objects_in_slice_with_gil(dst.data, dst.shape, # <<<<<<<<<<<<<<
19925  * dst.strides, ndim, inc)
19926  *
19927  */
19928  __pyx_memoryview_refcount_objects_in_slice_with_gil(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_inc);
19929 
19930  /* "View.MemoryView":1362
19931  *
19932  *
19933  * if dtype_is_object: # <<<<<<<<<<<<<<
19934  * refcount_objects_in_slice_with_gil(dst.data, dst.shape,
19935  * dst.strides, ndim, inc)
19936  */
19937  }
19938 
19939  /* "View.MemoryView":1358
19940  *
19941  * @cname('__pyx_memoryview_refcount_copying')
19942  * cdef void refcount_copying(__Pyx_memviewslice *dst, bint dtype_is_object, # <<<<<<<<<<<<<<
19943  * int ndim, bint inc) nogil:
19944  *
19945  */
19946 
19947  /* function exit code */
19948 }
19949 
19950 /* "View.MemoryView":1367
19951  *
19952  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19953  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19954  * Py_ssize_t *strides, int ndim,
19955  * bint inc) with gil:
19956  */
19957 
19958 static void __pyx_memoryview_refcount_objects_in_slice_with_gil(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19959  __Pyx_RefNannyDeclarations
19960  #ifdef WITH_THREAD
19961  PyGILState_STATE __pyx_gilstate_save = __Pyx_PyGILState_Ensure();
19962  #endif
19963  __Pyx_RefNannySetupContext("refcount_objects_in_slice_with_gil", 0);
19964 
19965  /* "View.MemoryView":1370
19966  * Py_ssize_t *strides, int ndim,
19967  * bint inc) with gil:
19968  * refcount_objects_in_slice(data, shape, strides, ndim, inc) # <<<<<<<<<<<<<<
19969  *
19970  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19971  */
19972  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, __pyx_v_shape, __pyx_v_strides, __pyx_v_ndim, __pyx_v_inc);
19973 
19974  /* "View.MemoryView":1367
19975  *
19976  * @cname('__pyx_memoryview_refcount_objects_in_slice_with_gil')
19977  * cdef void refcount_objects_in_slice_with_gil(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19978  * Py_ssize_t *strides, int ndim,
19979  * bint inc) with gil:
19980  */
19981 
19982  /* function exit code */
19983  __Pyx_RefNannyFinishContext();
19984  #ifdef WITH_THREAD
19985  __Pyx_PyGILState_Release(__pyx_gilstate_save);
19986  #endif
19987 }
19988 
19989 /* "View.MemoryView":1373
19990  *
19991  * @cname('__pyx_memoryview_refcount_objects_in_slice')
19992  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
19993  * Py_ssize_t *strides, int ndim, bint inc):
19994  * cdef Py_ssize_t i
19995  */
19996 
19997 static void __pyx_memoryview_refcount_objects_in_slice(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, int __pyx_v_inc) {
19998  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
19999  __Pyx_RefNannyDeclarations
20000  Py_ssize_t __pyx_t_1;
20001  Py_ssize_t __pyx_t_2;
20002  Py_ssize_t __pyx_t_3;
20003  int __pyx_t_4;
20004  __Pyx_RefNannySetupContext("refcount_objects_in_slice", 0);
20005 
20006  /* "View.MemoryView":1377
20007  * cdef Py_ssize_t i
20008  *
20009  * for i in range(shape[0]): # <<<<<<<<<<<<<<
20010  * if ndim == 1:
20011  * if inc:
20012  */
20013  __pyx_t_1 = (__pyx_v_shape[0]);
20014  __pyx_t_2 = __pyx_t_1;
20015  for (__pyx_t_3 = 0; __pyx_t_3 < __pyx_t_2; __pyx_t_3+=1) {
20016  __pyx_v_i = __pyx_t_3;
20017 
20018  /* "View.MemoryView":1378
20019  *
20020  * for i in range(shape[0]):
20021  * if ndim == 1: # <<<<<<<<<<<<<<
20022  * if inc:
20023  * Py_INCREF((<PyObject **> data)[0])
20024  */
20025  __pyx_t_4 = ((__pyx_v_ndim == 1) != 0);
20026  if (__pyx_t_4) {
20027 
20028  /* "View.MemoryView":1379
20029  * for i in range(shape[0]):
20030  * if ndim == 1:
20031  * if inc: # <<<<<<<<<<<<<<
20032  * Py_INCREF((<PyObject **> data)[0])
20033  * else:
20034  */
20035  __pyx_t_4 = (__pyx_v_inc != 0);
20036  if (__pyx_t_4) {
20037 
20038  /* "View.MemoryView":1380
20039  * if ndim == 1:
20040  * if inc:
20041  * Py_INCREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20042  * else:
20043  * Py_DECREF((<PyObject **> data)[0])
20044  */
20045  Py_INCREF((((PyObject **)__pyx_v_data)[0]));
20046 
20047  /* "View.MemoryView":1379
20048  * for i in range(shape[0]):
20049  * if ndim == 1:
20050  * if inc: # <<<<<<<<<<<<<<
20051  * Py_INCREF((<PyObject **> data)[0])
20052  * else:
20053  */
20054  goto __pyx_L6;
20055  }
20056 
20057  /* "View.MemoryView":1382
20058  * Py_INCREF((<PyObject **> data)[0])
20059  * else:
20060  * Py_DECREF((<PyObject **> data)[0]) # <<<<<<<<<<<<<<
20061  * else:
20062  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20063  */
20064  /*else*/ {
20065  Py_DECREF((((PyObject **)__pyx_v_data)[0]));
20066  }
20067  __pyx_L6:;
20068 
20069  /* "View.MemoryView":1378
20070  *
20071  * for i in range(shape[0]):
20072  * if ndim == 1: # <<<<<<<<<<<<<<
20073  * if inc:
20074  * Py_INCREF((<PyObject **> data)[0])
20075  */
20076  goto __pyx_L5;
20077  }
20078 
20079  /* "View.MemoryView":1384
20080  * Py_DECREF((<PyObject **> data)[0])
20081  * else:
20082  * refcount_objects_in_slice(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20083  * ndim - 1, inc)
20084  *
20085  */
20086  /*else*/ {
20087 
20088  /* "View.MemoryView":1385
20089  * else:
20090  * refcount_objects_in_slice(data, shape + 1, strides + 1,
20091  * ndim - 1, inc) # <<<<<<<<<<<<<<
20092  *
20093  * data += strides[0]
20094  */
20095  __pyx_memoryview_refcount_objects_in_slice(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_inc);
20096  }
20097  __pyx_L5:;
20098 
20099  /* "View.MemoryView":1387
20100  * ndim - 1, inc)
20101  *
20102  * data += strides[0] # <<<<<<<<<<<<<<
20103  *
20104  *
20105  */
20106  __pyx_v_data = (__pyx_v_data + (__pyx_v_strides[0]));
20107  }
20108 
20109  /* "View.MemoryView":1373
20110  *
20111  * @cname('__pyx_memoryview_refcount_objects_in_slice')
20112  * cdef void refcount_objects_in_slice(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20113  * Py_ssize_t *strides, int ndim, bint inc):
20114  * cdef Py_ssize_t i
20115  */
20116 
20117  /* function exit code */
20118  __Pyx_RefNannyFinishContext();
20119 }
20120 
20121 /* "View.MemoryView":1393
20122  *
20123  * @cname('__pyx_memoryview_slice_assign_scalar')
20124  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20125  * size_t itemsize, void *item,
20126  * bint dtype_is_object) nogil:
20127  */
20128 
20129 static void __pyx_memoryview_slice_assign_scalar(__Pyx_memviewslice *__pyx_v_dst, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item, int __pyx_v_dtype_is_object) {
20130 
20131  /* "View.MemoryView":1396
20132  * size_t itemsize, void *item,
20133  * bint dtype_is_object) nogil:
20134  * refcount_copying(dst, dtype_is_object, ndim, False) # <<<<<<<<<<<<<<
20135  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20136  * itemsize, item)
20137  */
20138  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 0);
20139 
20140  /* "View.MemoryView":1397
20141  * bint dtype_is_object) nogil:
20142  * refcount_copying(dst, dtype_is_object, ndim, False)
20143  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim, # <<<<<<<<<<<<<<
20144  * itemsize, item)
20145  * refcount_copying(dst, dtype_is_object, ndim, True)
20146  */
20147  __pyx_memoryview__slice_assign_scalar(__pyx_v_dst->data, __pyx_v_dst->shape, __pyx_v_dst->strides, __pyx_v_ndim, __pyx_v_itemsize, __pyx_v_item);
20148 
20149  /* "View.MemoryView":1399
20150  * _slice_assign_scalar(dst.data, dst.shape, dst.strides, ndim,
20151  * itemsize, item)
20152  * refcount_copying(dst, dtype_is_object, ndim, True) # <<<<<<<<<<<<<<
20153  *
20154  *
20155  */
20156  __pyx_memoryview_refcount_copying(__pyx_v_dst, __pyx_v_dtype_is_object, __pyx_v_ndim, 1);
20157 
20158  /* "View.MemoryView":1393
20159  *
20160  * @cname('__pyx_memoryview_slice_assign_scalar')
20161  * cdef void slice_assign_scalar(__Pyx_memviewslice *dst, int ndim, # <<<<<<<<<<<<<<
20162  * size_t itemsize, void *item,
20163  * bint dtype_is_object) nogil:
20164  */
20165 
20166  /* function exit code */
20167 }
20168 
20169 /* "View.MemoryView":1403
20170  *
20171  * @cname('__pyx_memoryview__slice_assign_scalar')
20172  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20173  * Py_ssize_t *strides, int ndim,
20174  * size_t itemsize, void *item) nogil:
20175  */
20176 
20177 static void __pyx_memoryview__slice_assign_scalar(char *__pyx_v_data, Py_ssize_t *__pyx_v_shape, Py_ssize_t *__pyx_v_strides, int __pyx_v_ndim, size_t __pyx_v_itemsize, void *__pyx_v_item) {
20178  CYTHON_UNUSED Py_ssize_t __pyx_v_i;
20179  Py_ssize_t __pyx_v_stride;
20180  Py_ssize_t __pyx_v_extent;
20181  int __pyx_t_1;
20182  Py_ssize_t __pyx_t_2;
20183  Py_ssize_t __pyx_t_3;
20184  Py_ssize_t __pyx_t_4;
20185 
20186  /* "View.MemoryView":1407
20187  * size_t itemsize, void *item) nogil:
20188  * cdef Py_ssize_t i
20189  * cdef Py_ssize_t stride = strides[0] # <<<<<<<<<<<<<<
20190  * cdef Py_ssize_t extent = shape[0]
20191  *
20192  */
20193  __pyx_v_stride = (__pyx_v_strides[0]);
20194 
20195  /* "View.MemoryView":1408
20196  * cdef Py_ssize_t i
20197  * cdef Py_ssize_t stride = strides[0]
20198  * cdef Py_ssize_t extent = shape[0] # <<<<<<<<<<<<<<
20199  *
20200  * if ndim == 1:
20201  */
20202  __pyx_v_extent = (__pyx_v_shape[0]);
20203 
20204  /* "View.MemoryView":1410
20205  * cdef Py_ssize_t extent = shape[0]
20206  *
20207  * if ndim == 1: # <<<<<<<<<<<<<<
20208  * for i in range(extent):
20209  * memcpy(data, item, itemsize)
20210  */
20211  __pyx_t_1 = ((__pyx_v_ndim == 1) != 0);
20212  if (__pyx_t_1) {
20213 
20214  /* "View.MemoryView":1411
20215  *
20216  * if ndim == 1:
20217  * for i in range(extent): # <<<<<<<<<<<<<<
20218  * memcpy(data, item, itemsize)
20219  * data += stride
20220  */
20221  __pyx_t_2 = __pyx_v_extent;
20222  __pyx_t_3 = __pyx_t_2;
20223  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20224  __pyx_v_i = __pyx_t_4;
20225 
20226  /* "View.MemoryView":1412
20227  * if ndim == 1:
20228  * for i in range(extent):
20229  * memcpy(data, item, itemsize) # <<<<<<<<<<<<<<
20230  * data += stride
20231  * else:
20232  */
20233  (void)(memcpy(__pyx_v_data, __pyx_v_item, __pyx_v_itemsize));
20234 
20235  /* "View.MemoryView":1413
20236  * for i in range(extent):
20237  * memcpy(data, item, itemsize)
20238  * data += stride # <<<<<<<<<<<<<<
20239  * else:
20240  * for i in range(extent):
20241  */
20242  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20243  }
20244 
20245  /* "View.MemoryView":1410
20246  * cdef Py_ssize_t extent = shape[0]
20247  *
20248  * if ndim == 1: # <<<<<<<<<<<<<<
20249  * for i in range(extent):
20250  * memcpy(data, item, itemsize)
20251  */
20252  goto __pyx_L3;
20253  }
20254 
20255  /* "View.MemoryView":1415
20256  * data += stride
20257  * else:
20258  * for i in range(extent): # <<<<<<<<<<<<<<
20259  * _slice_assign_scalar(data, shape + 1, strides + 1,
20260  * ndim - 1, itemsize, item)
20261  */
20262  /*else*/ {
20263  __pyx_t_2 = __pyx_v_extent;
20264  __pyx_t_3 = __pyx_t_2;
20265  for (__pyx_t_4 = 0; __pyx_t_4 < __pyx_t_3; __pyx_t_4+=1) {
20266  __pyx_v_i = __pyx_t_4;
20267 
20268  /* "View.MemoryView":1416
20269  * else:
20270  * for i in range(extent):
20271  * _slice_assign_scalar(data, shape + 1, strides + 1, # <<<<<<<<<<<<<<
20272  * ndim - 1, itemsize, item)
20273  * data += stride
20274  */
20275  __pyx_memoryview__slice_assign_scalar(__pyx_v_data, (__pyx_v_shape + 1), (__pyx_v_strides + 1), (__pyx_v_ndim - 1), __pyx_v_itemsize, __pyx_v_item);
20276 
20277  /* "View.MemoryView":1418
20278  * _slice_assign_scalar(data, shape + 1, strides + 1,
20279  * ndim - 1, itemsize, item)
20280  * data += stride # <<<<<<<<<<<<<<
20281  *
20282  *
20283  */
20284  __pyx_v_data = (__pyx_v_data + __pyx_v_stride);
20285  }
20286  }
20287  __pyx_L3:;
20288 
20289  /* "View.MemoryView":1403
20290  *
20291  * @cname('__pyx_memoryview__slice_assign_scalar')
20292  * cdef void _slice_assign_scalar(char *data, Py_ssize_t *shape, # <<<<<<<<<<<<<<
20293  * Py_ssize_t *strides, int ndim,
20294  * size_t itemsize, void *item) nogil:
20295  */
20296 
20297  /* function exit code */
20298 }
20299 
20300 /* "(tree fragment)":1
20301  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20302  * if __pyx_checksum != 0xb068931:
20303  * from pickle import PickleError as __pyx_PickleError
20304  */
20305 
20306 /* Python wrapper */
20307 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds); /*proto*/
20308 static PyMethodDef __pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum = {"__pyx_unpickle_Enum", (PyCFunction)__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum, METH_VARARGS|METH_KEYWORDS, 0};
20309 static PyObject *__pyx_pw_15View_dot_MemoryView_1__pyx_unpickle_Enum(PyObject *__pyx_self, PyObject *__pyx_args, PyObject *__pyx_kwds) {
20310  PyObject *__pyx_v___pyx_type = 0;
20311  long __pyx_v___pyx_checksum;
20312  PyObject *__pyx_v___pyx_state = 0;
20313  PyObject *__pyx_r = 0;
20314  __Pyx_RefNannyDeclarations
20315  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum (wrapper)", 0);
20316  {
20317  static PyObject **__pyx_pyargnames[] = {&__pyx_n_s_pyx_type,&__pyx_n_s_pyx_checksum,&__pyx_n_s_pyx_state,0};
20318  PyObject* values[3] = {0,0,0};
20319  if (unlikely(__pyx_kwds)) {
20320  Py_ssize_t kw_args;
20321  const Py_ssize_t pos_args = PyTuple_GET_SIZE(__pyx_args);
20322  switch (pos_args) {
20323  case 3: values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20324  CYTHON_FALLTHROUGH;
20325  case 2: values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20326  CYTHON_FALLTHROUGH;
20327  case 1: values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20328  CYTHON_FALLTHROUGH;
20329  case 0: break;
20330  default: goto __pyx_L5_argtuple_error;
20331  }
20332  kw_args = PyDict_Size(__pyx_kwds);
20333  switch (pos_args) {
20334  case 0:
20335  if (likely((values[0] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_type)) != 0)) kw_args--;
20336  else goto __pyx_L5_argtuple_error;
20337  CYTHON_FALLTHROUGH;
20338  case 1:
20339  if (likely((values[1] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_checksum)) != 0)) kw_args--;
20340  else {
20341  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 1); __PYX_ERR(0, 1, __pyx_L3_error)
20342  }
20343  CYTHON_FALLTHROUGH;
20344  case 2:
20345  if (likely((values[2] = __Pyx_PyDict_GetItemStr(__pyx_kwds, __pyx_n_s_pyx_state)) != 0)) kw_args--;
20346  else {
20347  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, 2); __PYX_ERR(0, 1, __pyx_L3_error)
20348  }
20349  }
20350  if (unlikely(kw_args > 0)) {
20351  if (unlikely(__Pyx_ParseOptionalKeywords(__pyx_kwds, __pyx_pyargnames, 0, values, pos_args, "__pyx_unpickle_Enum") < 0)) __PYX_ERR(0, 1, __pyx_L3_error)
20352  }
20353  } else if (PyTuple_GET_SIZE(__pyx_args) != 3) {
20354  goto __pyx_L5_argtuple_error;
20355  } else {
20356  values[0] = PyTuple_GET_ITEM(__pyx_args, 0);
20357  values[1] = PyTuple_GET_ITEM(__pyx_args, 1);
20358  values[2] = PyTuple_GET_ITEM(__pyx_args, 2);
20359  }
20360  __pyx_v___pyx_type = values[0];
20361  __pyx_v___pyx_checksum = __Pyx_PyInt_As_long(values[1]); if (unlikely((__pyx_v___pyx_checksum == (long)-1) && PyErr_Occurred())) __PYX_ERR(0, 1, __pyx_L3_error)
20362  __pyx_v___pyx_state = values[2];
20363  }
20364  goto __pyx_L4_argument_unpacking_done;
20365  __pyx_L5_argtuple_error:;
20366  __Pyx_RaiseArgtupleInvalid("__pyx_unpickle_Enum", 1, 3, 3, PyTuple_GET_SIZE(__pyx_args)); __PYX_ERR(0, 1, __pyx_L3_error)
20367  __pyx_L3_error:;
20368  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20369  __Pyx_RefNannyFinishContext();
20370  return NULL;
20371  __pyx_L4_argument_unpacking_done:;
20372  __pyx_r = __pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(__pyx_self, __pyx_v___pyx_type, __pyx_v___pyx_checksum, __pyx_v___pyx_state);
20373 
20374  /* function exit code */
20375  __Pyx_RefNannyFinishContext();
20376  return __pyx_r;
20377 }
20378 
20379 static PyObject *__pyx_pf_15View_dot_MemoryView___pyx_unpickle_Enum(CYTHON_UNUSED PyObject *__pyx_self, PyObject *__pyx_v___pyx_type, long __pyx_v___pyx_checksum, PyObject *__pyx_v___pyx_state) {
20380  PyObject *__pyx_v___pyx_PickleError = NULL;
20381  PyObject *__pyx_v___pyx_result = NULL;
20382  PyObject *__pyx_r = NULL;
20383  __Pyx_RefNannyDeclarations
20384  int __pyx_t_1;
20385  PyObject *__pyx_t_2 = NULL;
20386  PyObject *__pyx_t_3 = NULL;
20387  PyObject *__pyx_t_4 = NULL;
20388  PyObject *__pyx_t_5 = NULL;
20389  PyObject *__pyx_t_6 = NULL;
20390  int __pyx_t_7;
20391  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum", 0);
20392 
20393  /* "(tree fragment)":2
20394  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
20395  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20396  * from pickle import PickleError as __pyx_PickleError
20397  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20398  */
20399  __pyx_t_1 = ((__pyx_v___pyx_checksum != 0xb068931) != 0);
20400  if (__pyx_t_1) {
20401 
20402  /* "(tree fragment)":3
20403  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
20404  * if __pyx_checksum != 0xb068931:
20405  * from pickle import PickleError as __pyx_PickleError # <<<<<<<<<<<<<<
20406  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20407  * __pyx_result = Enum.__new__(__pyx_type)
20408  */
20409  __pyx_t_2 = PyList_New(1); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
20410  __Pyx_GOTREF(__pyx_t_2);
20411  __Pyx_INCREF(__pyx_n_s_PickleError);
20412  __Pyx_GIVEREF(__pyx_n_s_PickleError);
20413  PyList_SET_ITEM(__pyx_t_2, 0, __pyx_n_s_PickleError);
20414  __pyx_t_3 = __Pyx_Import(__pyx_n_s_pickle, __pyx_t_2, 0); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 3, __pyx_L1_error)
20415  __Pyx_GOTREF(__pyx_t_3);
20416  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20417  __pyx_t_2 = __Pyx_ImportFrom(__pyx_t_3, __pyx_n_s_PickleError); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 3, __pyx_L1_error)
20418  __Pyx_GOTREF(__pyx_t_2);
20419  __Pyx_INCREF(__pyx_t_2);
20420  __pyx_v___pyx_PickleError = __pyx_t_2;
20421  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20422  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20423 
20424  /* "(tree fragment)":4
20425  * if __pyx_checksum != 0xb068931:
20426  * from pickle import PickleError as __pyx_PickleError
20427  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum) # <<<<<<<<<<<<<<
20428  * __pyx_result = Enum.__new__(__pyx_type)
20429  * if __pyx_state is not None:
20430  */
20431  __pyx_t_2 = __Pyx_PyInt_From_long(__pyx_v___pyx_checksum); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 4, __pyx_L1_error)
20432  __Pyx_GOTREF(__pyx_t_2);
20433  __pyx_t_4 = __Pyx_PyString_Format(__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_t_2); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 4, __pyx_L1_error)
20434  __Pyx_GOTREF(__pyx_t_4);
20435  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20436  __Pyx_INCREF(__pyx_v___pyx_PickleError);
20437  __pyx_t_2 = __pyx_v___pyx_PickleError; __pyx_t_5 = NULL;
20438  if (CYTHON_UNPACK_METHODS && unlikely(PyMethod_Check(__pyx_t_2))) {
20439  __pyx_t_5 = PyMethod_GET_SELF(__pyx_t_2);
20440  if (likely(__pyx_t_5)) {
20441  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20442  __Pyx_INCREF(__pyx_t_5);
20443  __Pyx_INCREF(function);
20444  __Pyx_DECREF_SET(__pyx_t_2, function);
20445  }
20446  }
20447  if (!__pyx_t_5) {
20448  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_t_4); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
20449  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20450  __Pyx_GOTREF(__pyx_t_3);
20451  } else {
20452  #if CYTHON_FAST_PYCALL
20453  if (PyFunction_Check(__pyx_t_2)) {
20454  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
20455  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
20456  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20457  __Pyx_GOTREF(__pyx_t_3);
20458  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20459  } else
20460  #endif
20461  #if CYTHON_FAST_PYCCALL
20462  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20463  PyObject *__pyx_temp[2] = {__pyx_t_5, __pyx_t_4};
20464  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
20465  __Pyx_XDECREF(__pyx_t_5); __pyx_t_5 = 0;
20466  __Pyx_GOTREF(__pyx_t_3);
20467  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20468  } else
20469  #endif
20470  {
20471  __pyx_t_6 = PyTuple_New(1+1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 4, __pyx_L1_error)
20472  __Pyx_GOTREF(__pyx_t_6);
20473  __Pyx_GIVEREF(__pyx_t_5); PyTuple_SET_ITEM(__pyx_t_6, 0, __pyx_t_5); __pyx_t_5 = NULL;
20474  __Pyx_GIVEREF(__pyx_t_4);
20475  PyTuple_SET_ITEM(__pyx_t_6, 0+1, __pyx_t_4);
20476  __pyx_t_4 = 0;
20477  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_6, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 4, __pyx_L1_error)
20478  __Pyx_GOTREF(__pyx_t_3);
20479  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20480  }
20481  }
20482  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20483  __Pyx_Raise(__pyx_t_3, 0, 0, 0);
20484  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20485  __PYX_ERR(0, 4, __pyx_L1_error)
20486 
20487  /* "(tree fragment)":2
20488  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state):
20489  * if __pyx_checksum != 0xb068931: # <<<<<<<<<<<<<<
20490  * from pickle import PickleError as __pyx_PickleError
20491  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20492  */
20493  }
20494 
20495  /* "(tree fragment)":5
20496  * from pickle import PickleError as __pyx_PickleError
20497  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20498  * __pyx_result = Enum.__new__(__pyx_type) # <<<<<<<<<<<<<<
20499  * if __pyx_state is not None:
20500  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20501  */
20502  __pyx_t_2 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_MemviewEnum_type), __pyx_n_s_new); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 5, __pyx_L1_error)
20503  __Pyx_GOTREF(__pyx_t_2);
20504  __pyx_t_6 = NULL;
20505  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_2))) {
20506  __pyx_t_6 = PyMethod_GET_SELF(__pyx_t_2);
20507  if (likely(__pyx_t_6)) {
20508  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_2);
20509  __Pyx_INCREF(__pyx_t_6);
20510  __Pyx_INCREF(function);
20511  __Pyx_DECREF_SET(__pyx_t_2, function);
20512  }
20513  }
20514  if (!__pyx_t_6) {
20515  __pyx_t_3 = __Pyx_PyObject_CallOneArg(__pyx_t_2, __pyx_v___pyx_type); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
20516  __Pyx_GOTREF(__pyx_t_3);
20517  } else {
20518  #if CYTHON_FAST_PYCALL
20519  if (PyFunction_Check(__pyx_t_2)) {
20520  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
20521  __pyx_t_3 = __Pyx_PyFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
20522  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20523  __Pyx_GOTREF(__pyx_t_3);
20524  } else
20525  #endif
20526  #if CYTHON_FAST_PYCCALL
20527  if (__Pyx_PyFastCFunction_Check(__pyx_t_2)) {
20528  PyObject *__pyx_temp[2] = {__pyx_t_6, __pyx_v___pyx_type};
20529  __pyx_t_3 = __Pyx_PyCFunction_FastCall(__pyx_t_2, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
20530  __Pyx_XDECREF(__pyx_t_6); __pyx_t_6 = 0;
20531  __Pyx_GOTREF(__pyx_t_3);
20532  } else
20533  #endif
20534  {
20535  __pyx_t_4 = PyTuple_New(1+1); if (unlikely(!__pyx_t_4)) __PYX_ERR(0, 5, __pyx_L1_error)
20536  __Pyx_GOTREF(__pyx_t_4);
20537  __Pyx_GIVEREF(__pyx_t_6); PyTuple_SET_ITEM(__pyx_t_4, 0, __pyx_t_6); __pyx_t_6 = NULL;
20538  __Pyx_INCREF(__pyx_v___pyx_type);
20539  __Pyx_GIVEREF(__pyx_v___pyx_type);
20540  PyTuple_SET_ITEM(__pyx_t_4, 0+1, __pyx_v___pyx_type);
20541  __pyx_t_3 = __Pyx_PyObject_Call(__pyx_t_2, __pyx_t_4, NULL); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 5, __pyx_L1_error)
20542  __Pyx_GOTREF(__pyx_t_3);
20543  __Pyx_DECREF(__pyx_t_4); __pyx_t_4 = 0;
20544  }
20545  }
20546  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
20547  __pyx_v___pyx_result = __pyx_t_3;
20548  __pyx_t_3 = 0;
20549 
20550  /* "(tree fragment)":6
20551  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20552  * __pyx_result = Enum.__new__(__pyx_type)
20553  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20554  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20555  * return __pyx_result
20556  */
20557  __pyx_t_1 = (__pyx_v___pyx_state != Py_None);
20558  __pyx_t_7 = (__pyx_t_1 != 0);
20559  if (__pyx_t_7) {
20560 
20561  /* "(tree fragment)":7
20562  * __pyx_result = Enum.__new__(__pyx_type)
20563  * if __pyx_state is not None:
20564  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state) # <<<<<<<<<<<<<<
20565  * return __pyx_result
20566  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20567  */
20568  if (!(likely(PyTuple_CheckExact(__pyx_v___pyx_state))||((__pyx_v___pyx_state) == Py_None)||(PyErr_Format(PyExc_TypeError, "Expected %.16s, got %.200s", "tuple", Py_TYPE(__pyx_v___pyx_state)->tp_name), 0))) __PYX_ERR(0, 7, __pyx_L1_error)
20569  __pyx_t_3 = __pyx_unpickle_Enum__set_state(((struct __pyx_MemviewEnum_obj *)__pyx_v___pyx_result), ((PyObject*)__pyx_v___pyx_state)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 7, __pyx_L1_error)
20570  __Pyx_GOTREF(__pyx_t_3);
20571  __Pyx_DECREF(__pyx_t_3); __pyx_t_3 = 0;
20572 
20573  /* "(tree fragment)":6
20574  * raise __pyx_PickleError("Incompatible checksums (%s vs 0xb068931 = (name))" % __pyx_checksum)
20575  * __pyx_result = Enum.__new__(__pyx_type)
20576  * if __pyx_state is not None: # <<<<<<<<<<<<<<
20577  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20578  * return __pyx_result
20579  */
20580  }
20581 
20582  /* "(tree fragment)":8
20583  * if __pyx_state is not None:
20584  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20585  * return __pyx_result # <<<<<<<<<<<<<<
20586  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20587  * __pyx_result.name = __pyx_state[0]
20588  */
20589  __Pyx_XDECREF(__pyx_r);
20590  __Pyx_INCREF(__pyx_v___pyx_result);
20591  __pyx_r = __pyx_v___pyx_result;
20592  goto __pyx_L0;
20593 
20594  /* "(tree fragment)":1
20595  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
20596  * if __pyx_checksum != 0xb068931:
20597  * from pickle import PickleError as __pyx_PickleError
20598  */
20599 
20600  /* function exit code */
20601  __pyx_L1_error:;
20602  __Pyx_XDECREF(__pyx_t_2);
20603  __Pyx_XDECREF(__pyx_t_3);
20604  __Pyx_XDECREF(__pyx_t_4);
20605  __Pyx_XDECREF(__pyx_t_5);
20606  __Pyx_XDECREF(__pyx_t_6);
20607  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum", __pyx_clineno, __pyx_lineno, __pyx_filename);
20608  __pyx_r = NULL;
20609  __pyx_L0:;
20610  __Pyx_XDECREF(__pyx_v___pyx_PickleError);
20611  __Pyx_XDECREF(__pyx_v___pyx_result);
20612  __Pyx_XGIVEREF(__pyx_r);
20613  __Pyx_RefNannyFinishContext();
20614  return __pyx_r;
20615 }
20616 
20617 /* "(tree fragment)":9
20618  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20619  * return __pyx_result
20620  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20621  * __pyx_result.name = __pyx_state[0]
20622  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20623  */
20624 
20625 static PyObject *__pyx_unpickle_Enum__set_state(struct __pyx_MemviewEnum_obj *__pyx_v___pyx_result, PyObject *__pyx_v___pyx_state) {
20626  PyObject *__pyx_r = NULL;
20627  __Pyx_RefNannyDeclarations
20628  PyObject *__pyx_t_1 = NULL;
20629  int __pyx_t_2;
20630  Py_ssize_t __pyx_t_3;
20631  int __pyx_t_4;
20632  int __pyx_t_5;
20633  PyObject *__pyx_t_6 = NULL;
20634  PyObject *__pyx_t_7 = NULL;
20635  PyObject *__pyx_t_8 = NULL;
20636  PyObject *__pyx_t_9 = NULL;
20637  __Pyx_RefNannySetupContext("__pyx_unpickle_Enum__set_state", 0);
20638 
20639  /* "(tree fragment)":10
20640  * return __pyx_result
20641  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20642  * __pyx_result.name = __pyx_state[0] # <<<<<<<<<<<<<<
20643  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20644  * __pyx_result.__dict__.update(__pyx_state[1])
20645  */
20646  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20647  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20648  __PYX_ERR(0, 10, __pyx_L1_error)
20649  }
20650  __pyx_t_1 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 0, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 10, __pyx_L1_error)
20651  __Pyx_GOTREF(__pyx_t_1);
20652  __Pyx_GIVEREF(__pyx_t_1);
20653  __Pyx_GOTREF(__pyx_v___pyx_result->name);
20654  __Pyx_DECREF(__pyx_v___pyx_result->name);
20655  __pyx_v___pyx_result->name = __pyx_t_1;
20656  __pyx_t_1 = 0;
20657 
20658  /* "(tree fragment)":11
20659  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20660  * __pyx_result.name = __pyx_state[0]
20661  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20662  * __pyx_result.__dict__.update(__pyx_state[1])
20663  */
20664  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20665  PyErr_SetString(PyExc_TypeError, "object of type 'NoneType' has no len()");
20666  __PYX_ERR(0, 11, __pyx_L1_error)
20667  }
20668  __pyx_t_3 = PyTuple_GET_SIZE(__pyx_v___pyx_state); if (unlikely(__pyx_t_3 == ((Py_ssize_t)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
20669  __pyx_t_4 = ((__pyx_t_3 > 1) != 0);
20670  if (__pyx_t_4) {
20671  } else {
20672  __pyx_t_2 = __pyx_t_4;
20673  goto __pyx_L4_bool_binop_done;
20674  }
20675  __pyx_t_4 = __Pyx_HasAttr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(__pyx_t_4 == ((int)-1))) __PYX_ERR(0, 11, __pyx_L1_error)
20676  __pyx_t_5 = (__pyx_t_4 != 0);
20677  __pyx_t_2 = __pyx_t_5;
20678  __pyx_L4_bool_binop_done:;
20679  if (__pyx_t_2) {
20680 
20681  /* "(tree fragment)":12
20682  * __pyx_result.name = __pyx_state[0]
20683  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20684  * __pyx_result.__dict__.update(__pyx_state[1]) # <<<<<<<<<<<<<<
20685  */
20686  __pyx_t_6 = __Pyx_PyObject_GetAttrStr(((PyObject *)__pyx_v___pyx_result), __pyx_n_s_dict); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error)
20687  __Pyx_GOTREF(__pyx_t_6);
20688  __pyx_t_7 = __Pyx_PyObject_GetAttrStr(__pyx_t_6, __pyx_n_s_update); if (unlikely(!__pyx_t_7)) __PYX_ERR(0, 12, __pyx_L1_error)
20689  __Pyx_GOTREF(__pyx_t_7);
20690  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20691  if (unlikely(__pyx_v___pyx_state == Py_None)) {
20692  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not subscriptable");
20693  __PYX_ERR(0, 12, __pyx_L1_error)
20694  }
20695  __pyx_t_6 = __Pyx_GetItemInt_Tuple(__pyx_v___pyx_state, 1, long, 1, __Pyx_PyInt_From_long, 0, 0, 1); if (unlikely(!__pyx_t_6)) __PYX_ERR(0, 12, __pyx_L1_error)
20696  __Pyx_GOTREF(__pyx_t_6);
20697  __pyx_t_8 = NULL;
20698  if (CYTHON_UNPACK_METHODS && likely(PyMethod_Check(__pyx_t_7))) {
20699  __pyx_t_8 = PyMethod_GET_SELF(__pyx_t_7);
20700  if (likely(__pyx_t_8)) {
20701  PyObject* function = PyMethod_GET_FUNCTION(__pyx_t_7);
20702  __Pyx_INCREF(__pyx_t_8);
20703  __Pyx_INCREF(function);
20704  __Pyx_DECREF_SET(__pyx_t_7, function);
20705  }
20706  }
20707  if (!__pyx_t_8) {
20708  __pyx_t_1 = __Pyx_PyObject_CallOneArg(__pyx_t_7, __pyx_t_6); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20709  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20710  __Pyx_GOTREF(__pyx_t_1);
20711  } else {
20712  #if CYTHON_FAST_PYCALL
20713  if (PyFunction_Check(__pyx_t_7)) {
20714  PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
20715  __pyx_t_1 = __Pyx_PyFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20716  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20717  __Pyx_GOTREF(__pyx_t_1);
20718  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20719  } else
20720  #endif
20721  #if CYTHON_FAST_PYCCALL
20722  if (__Pyx_PyFastCFunction_Check(__pyx_t_7)) {
20723  PyObject *__pyx_temp[2] = {__pyx_t_8, __pyx_t_6};
20724  __pyx_t_1 = __Pyx_PyCFunction_FastCall(__pyx_t_7, __pyx_temp+1-1, 1+1); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20725  __Pyx_XDECREF(__pyx_t_8); __pyx_t_8 = 0;
20726  __Pyx_GOTREF(__pyx_t_1);
20727  __Pyx_DECREF(__pyx_t_6); __pyx_t_6 = 0;
20728  } else
20729  #endif
20730  {
20731  __pyx_t_9 = PyTuple_New(1+1); if (unlikely(!__pyx_t_9)) __PYX_ERR(0, 12, __pyx_L1_error)
20732  __Pyx_GOTREF(__pyx_t_9);
20733  __Pyx_GIVEREF(__pyx_t_8); PyTuple_SET_ITEM(__pyx_t_9, 0, __pyx_t_8); __pyx_t_8 = NULL;
20734  __Pyx_GIVEREF(__pyx_t_6);
20735  PyTuple_SET_ITEM(__pyx_t_9, 0+1, __pyx_t_6);
20736  __pyx_t_6 = 0;
20737  __pyx_t_1 = __Pyx_PyObject_Call(__pyx_t_7, __pyx_t_9, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 12, __pyx_L1_error)
20738  __Pyx_GOTREF(__pyx_t_1);
20739  __Pyx_DECREF(__pyx_t_9); __pyx_t_9 = 0;
20740  }
20741  }
20742  __Pyx_DECREF(__pyx_t_7); __pyx_t_7 = 0;
20743  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
20744 
20745  /* "(tree fragment)":11
20746  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state):
20747  * __pyx_result.name = __pyx_state[0]
20748  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'): # <<<<<<<<<<<<<<
20749  * __pyx_result.__dict__.update(__pyx_state[1])
20750  */
20751  }
20752 
20753  /* "(tree fragment)":9
20754  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
20755  * return __pyx_result
20756  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
20757  * __pyx_result.name = __pyx_state[0]
20758  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
20759  */
20760 
20761  /* function exit code */
20762  __pyx_r = Py_None; __Pyx_INCREF(Py_None);
20763  goto __pyx_L0;
20764  __pyx_L1_error:;
20765  __Pyx_XDECREF(__pyx_t_1);
20766  __Pyx_XDECREF(__pyx_t_6);
20767  __Pyx_XDECREF(__pyx_t_7);
20768  __Pyx_XDECREF(__pyx_t_8);
20769  __Pyx_XDECREF(__pyx_t_9);
20770  __Pyx_AddTraceback("View.MemoryView.__pyx_unpickle_Enum__set_state", __pyx_clineno, __pyx_lineno, __pyx_filename);
20771  __pyx_r = 0;
20772  __pyx_L0:;
20773  __Pyx_XGIVEREF(__pyx_r);
20774  __Pyx_RefNannyFinishContext();
20775  return __pyx_r;
20776 }
20777 
20778 static PyObject *__pyx_tp_new_18BoundaryConditions_BC_Base(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20779  struct __pyx_obj_18BoundaryConditions_BC_Base *p;
20780  PyObject *o;
20781  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20782  o = (*t->tp_alloc)(t, 0);
20783  } else {
20784  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20785  }
20786  if (unlikely(!o)) return 0;
20787  p = ((struct __pyx_obj_18BoundaryConditions_BC_Base *)o);
20788  p->Shape = Py_None; Py_INCREF(Py_None);
20789  p->name = ((PyObject*)Py_None); Py_INCREF(Py_None);
20790  p->BC_type = ((PyObject*)Py_None); Py_INCREF(Py_None);
20791  p->ct = Py_None; Py_INCREF(Py_None);
20792  p->_b_or.data = NULL;
20793  p->_b_or.memview = NULL;
20794  return o;
20795 }
20796 
20797 static void __pyx_tp_dealloc_18BoundaryConditions_BC_Base(PyObject *o) {
20798  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
20799  #if CYTHON_USE_TP_FINALIZE
20800  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20801  if (PyObject_CallFinalizerFromDealloc(o)) return;
20802  }
20803  #endif
20804  PyObject_GC_UnTrack(o);
20805  Py_CLEAR(p->Shape);
20806  Py_CLEAR(p->name);
20807  Py_CLEAR(p->BC_type);
20808  Py_CLEAR(p->ct);
20809  __PYX_XDEC_MEMVIEW(&p->_b_or, 1);
20810  (*Py_TYPE(o)->tp_free)(o);
20811 }
20812 
20813 static int __pyx_tp_traverse_18BoundaryConditions_BC_Base(PyObject *o, visitproc v, void *a) {
20814  int e;
20815  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
20816  if (p->Shape) {
20817  e = (*v)(p->Shape, a); if (e) return e;
20818  }
20819  if (p->ct) {
20820  e = (*v)(p->ct, a); if (e) return e;
20821  }
20822  return 0;
20823 }
20824 
20825 static int __pyx_tp_clear_18BoundaryConditions_BC_Base(PyObject *o) {
20826  PyObject* tmp;
20827  struct __pyx_obj_18BoundaryConditions_BC_Base *p = (struct __pyx_obj_18BoundaryConditions_BC_Base *)o;
20828  tmp = ((PyObject*)p->Shape);
20829  p->Shape = Py_None; Py_INCREF(Py_None);
20830  Py_XDECREF(tmp);
20831  tmp = ((PyObject*)p->ct);
20832  p->ct = Py_None; Py_INCREF(Py_None);
20833  Py_XDECREF(tmp);
20834  return 0;
20835 }
20836 
20837 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, CYTHON_UNUSED void *x) {
20838  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_1__get__(o);
20839 }
20840 
20841 static int __pyx_setprop_18BoundaryConditions_7BC_Base_nd(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20842  if (v) {
20843  return __pyx_pw_18BoundaryConditions_7BC_Base_2nd_3__set__(o, v);
20844  }
20845  else {
20846  PyErr_SetString(PyExc_NotImplementedError, "__del__");
20847  return -1;
20848  }
20849 }
20850 
20851 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, CYTHON_UNUSED void *x) {
20852  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_1__get__(o);
20853 }
20854 
20855 static int __pyx_setprop_18BoundaryConditions_7BC_Base_Shape(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20856  if (v) {
20857  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_3__set__(o, v);
20858  }
20859  else {
20860  return __pyx_pw_18BoundaryConditions_7BC_Base_5Shape_5__del__(o);
20861  }
20862 }
20863 
20864 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_name(PyObject *o, CYTHON_UNUSED void *x) {
20865  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_1__get__(o);
20866 }
20867 
20868 static int __pyx_setprop_18BoundaryConditions_7BC_Base_name(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20869  if (v) {
20870  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_3__set__(o, v);
20871  }
20872  else {
20873  return __pyx_pw_18BoundaryConditions_7BC_Base_4name_5__del__(o);
20874  }
20875 }
20876 
20877 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, CYTHON_UNUSED void *x) {
20878  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_1__get__(o);
20879 }
20880 
20881 static int __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20882  if (v) {
20883  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_3__set__(o, v);
20884  }
20885  else {
20886  return __pyx_pw_18BoundaryConditions_7BC_Base_7BC_type_5__del__(o);
20887  }
20888 }
20889 
20890 static PyObject *__pyx_getprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, CYTHON_UNUSED void *x) {
20891  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_1__get__(o);
20892 }
20893 
20894 static int __pyx_setprop_18BoundaryConditions_7BC_Base_ct(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
20895  if (v) {
20896  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_3__set__(o, v);
20897  }
20898  else {
20899  return __pyx_pw_18BoundaryConditions_7BC_Base_2ct_5__del__(o);
20900  }
20901 }
20902 
20903 static PyMethodDef __pyx_methods_18BoundaryConditions_BC_Base[] = {
20904  {"getContext", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_3getContext, METH_VARARGS|METH_KEYWORDS, __pyx_doc_18BoundaryConditions_7BC_Base_2getContext},
20905  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_5__reduce_cython__, METH_NOARGS, 0},
20906  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_7BC_Base_7__setstate_cython__, METH_O, 0},
20907  {0, 0, 0, 0}
20908 };
20909 
20910 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BC_Base[] = {
20911  {(char *)"nd", __pyx_getprop_18BoundaryConditions_7BC_Base_nd, __pyx_setprop_18BoundaryConditions_7BC_Base_nd, (char *)0, 0},
20912  {(char *)"Shape", __pyx_getprop_18BoundaryConditions_7BC_Base_Shape, __pyx_setprop_18BoundaryConditions_7BC_Base_Shape, (char *)0, 0},
20913  {(char *)"name", __pyx_getprop_18BoundaryConditions_7BC_Base_name, __pyx_setprop_18BoundaryConditions_7BC_Base_name, (char *)0, 0},
20914  {(char *)"BC_type", __pyx_getprop_18BoundaryConditions_7BC_Base_BC_type, __pyx_setprop_18BoundaryConditions_7BC_Base_BC_type, (char *)0, 0},
20915  {(char *)"ct", __pyx_getprop_18BoundaryConditions_7BC_Base_ct, __pyx_setprop_18BoundaryConditions_7BC_Base_ct, (char *)0, 0},
20916  {0, 0, 0, 0, 0}
20917 };
20918 
20919 static PyTypeObject __pyx_type_18BoundaryConditions_BC_Base = {
20920  PyVarObject_HEAD_INIT(0, 0)
20921  "BoundaryConditions.BC_Base", /*tp_name*/
20922  sizeof(struct __pyx_obj_18BoundaryConditions_BC_Base), /*tp_basicsize*/
20923  0, /*tp_itemsize*/
20924  __pyx_tp_dealloc_18BoundaryConditions_BC_Base, /*tp_dealloc*/
20925  0, /*tp_print*/
20926  0, /*tp_getattr*/
20927  0, /*tp_setattr*/
20928  #if PY_MAJOR_VERSION < 3
20929  0, /*tp_compare*/
20930  #endif
20931  #if PY_MAJOR_VERSION >= 3
20932  0, /*tp_as_async*/
20933  #endif
20934  0, /*tp_repr*/
20935  0, /*tp_as_number*/
20936  0, /*tp_as_sequence*/
20937  0, /*tp_as_mapping*/
20938  0, /*tp_hash*/
20939  0, /*tp_call*/
20940  0, /*tp_str*/
20941  0, /*tp_getattro*/
20942  0, /*tp_setattro*/
20943  0, /*tp_as_buffer*/
20944  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
20945  "\n Generic class regrouping boundary conditions\n ", /*tp_doc*/
20946  __pyx_tp_traverse_18BoundaryConditions_BC_Base, /*tp_traverse*/
20947  __pyx_tp_clear_18BoundaryConditions_BC_Base, /*tp_clear*/
20948  0, /*tp_richcompare*/
20949  0, /*tp_weaklistoffset*/
20950  0, /*tp_iter*/
20951  0, /*tp_iternext*/
20952  __pyx_methods_18BoundaryConditions_BC_Base, /*tp_methods*/
20953  0, /*tp_members*/
20954  __pyx_getsets_18BoundaryConditions_BC_Base, /*tp_getset*/
20955  0, /*tp_base*/
20956  0, /*tp_dict*/
20957  0, /*tp_descr_get*/
20958  0, /*tp_descr_set*/
20959  0, /*tp_dictoffset*/
20960  __pyx_pw_18BoundaryConditions_7BC_Base_1__init__, /*tp_init*/
20961  0, /*tp_alloc*/
20962  __pyx_tp_new_18BoundaryConditions_BC_Base, /*tp_new*/
20963  0, /*tp_free*/
20964  0, /*tp_is_gc*/
20965  0, /*tp_bases*/
20966  0, /*tp_mro*/
20967  0, /*tp_cache*/
20968  0, /*tp_subclasses*/
20969  0, /*tp_weaklist*/
20970  0, /*tp_del*/
20971  0, /*tp_version_tag*/
20972  #if PY_VERSION_HEX >= 0x030400a1
20973  0, /*tp_finalize*/
20974  #endif
20975 };
20976 static struct __pyx_vtabstruct_18BoundaryConditions_BoundaryCondition __pyx_vtable_18BoundaryConditions_BoundaryCondition;
20977 
20978 static PyObject *__pyx_tp_new_18BoundaryConditions_BoundaryCondition(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
20979  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p;
20980  PyObject *o;
20981  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
20982  o = (*t->tp_alloc)(t, 0);
20983  } else {
20984  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
20985  }
20986  if (unlikely(!o)) return 0;
20987  p = ((struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o);
20988  p->__pyx_vtab = __pyx_vtabptr_18BoundaryConditions_BoundaryCondition;
20989  p->uOfXT = Py_None; Py_INCREF(Py_None);
20990  return o;
20991 }
20992 
20993 static void __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition(PyObject *o) {
20994  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
20995  #if CYTHON_USE_TP_FINALIZE
20996  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
20997  if (PyObject_CallFinalizerFromDealloc(o)) return;
20998  }
20999  #endif
21000  PyObject_GC_UnTrack(o);
21001  Py_CLEAR(p->uOfXT);
21002  (*Py_TYPE(o)->tp_free)(o);
21003 }
21004 
21005 static int __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition(PyObject *o, visitproc v, void *a) {
21006  int e;
21007  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21008  if (p->uOfXT) {
21009  e = (*v)(p->uOfXT, a); if (e) return e;
21010  }
21011  return 0;
21012 }
21013 
21014 static int __pyx_tp_clear_18BoundaryConditions_BoundaryCondition(PyObject *o) {
21015  PyObject* tmp;
21016  struct __pyx_obj_18BoundaryConditions_BoundaryCondition *p = (struct __pyx_obj_18BoundaryConditions_BoundaryCondition *)o;
21017  tmp = ((PyObject*)p->uOfXT);
21018  p->uOfXT = Py_None; Py_INCREF(Py_None);
21019  Py_XDECREF(tmp);
21020  return 0;
21021 }
21022 
21023 static PyObject *__pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, CYTHON_UNUSED void *x) {
21024  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_1__get__(o);
21025 }
21026 
21027 static int __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT(PyObject *o, PyObject *v, CYTHON_UNUSED void *x) {
21028  if (v) {
21029  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_3__set__(o, v);
21030  }
21031  else {
21032  return __pyx_pw_18BoundaryConditions_17BoundaryCondition_5uOfXT_5__del__(o);
21033  }
21034 }
21035 
21036 static PyMethodDef __pyx_methods_18BoundaryConditions_BoundaryCondition[] = {
21037  {"init_cython", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_3init_cython, METH_NOARGS, 0},
21038  {"setConstantBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_7setConstantBC, METH_O, __pyx_doc_18BoundaryConditions_17BoundaryCondition_6setConstantBC},
21039  {"setLinearBC", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_9setLinearBC, METH_VARARGS|METH_KEYWORDS, 0},
21040  {"__reduce_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__, METH_NOARGS, 0},
21041  {"__setstate_cython__", (PyCFunction)__pyx_pw_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__, METH_O, 0},
21042  {0, 0, 0, 0}
21043 };
21044 
21045 static struct PyGetSetDef __pyx_getsets_18BoundaryConditions_BoundaryCondition[] = {
21046  {(char *)"uOfXT", __pyx_getprop_18BoundaryConditions_17BoundaryCondition_uOfXT, __pyx_setprop_18BoundaryConditions_17BoundaryCondition_uOfXT, (char *)0, 0},
21047  {0, 0, 0, 0, 0}
21048 };
21049 
21050 static PyTypeObject __pyx_type_18BoundaryConditions_BoundaryCondition = {
21051  PyVarObject_HEAD_INIT(0, 0)
21052  "BoundaryConditions.BoundaryCondition", /*tp_name*/
21053  sizeof(struct __pyx_obj_18BoundaryConditions_BoundaryCondition), /*tp_basicsize*/
21054  0, /*tp_itemsize*/
21055  __pyx_tp_dealloc_18BoundaryConditions_BoundaryCondition, /*tp_dealloc*/
21056  0, /*tp_print*/
21057  0, /*tp_getattr*/
21058  0, /*tp_setattr*/
21059  #if PY_MAJOR_VERSION < 3
21060  0, /*tp_compare*/
21061  #endif
21062  #if PY_MAJOR_VERSION >= 3
21063  0, /*tp_as_async*/
21064  #endif
21065  0, /*tp_repr*/
21066  0, /*tp_as_number*/
21067  0, /*tp_as_sequence*/
21068  0, /*tp_as_mapping*/
21069  0, /*tp_hash*/
21070  0, /*tp_call*/
21071  0, /*tp_str*/
21072  0, /*tp_getattro*/
21073  0, /*tp_setattro*/
21074  0, /*tp_as_buffer*/
21075  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21076  "\n Boundary condition class\n\n Attributes\n ----------\n uOfXT: func or None\n boundary condition function of x (array_like) and t (float) or None for\n no boundary condition\n ", /*tp_doc*/
21077  __pyx_tp_traverse_18BoundaryConditions_BoundaryCondition, /*tp_traverse*/
21078  __pyx_tp_clear_18BoundaryConditions_BoundaryCondition, /*tp_clear*/
21079  0, /*tp_richcompare*/
21080  0, /*tp_weaklistoffset*/
21081  0, /*tp_iter*/
21082  0, /*tp_iternext*/
21083  __pyx_methods_18BoundaryConditions_BoundaryCondition, /*tp_methods*/
21084  0, /*tp_members*/
21085  __pyx_getsets_18BoundaryConditions_BoundaryCondition, /*tp_getset*/
21086  0, /*tp_base*/
21087  0, /*tp_dict*/
21088  0, /*tp_descr_get*/
21089  0, /*tp_descr_set*/
21090  0, /*tp_dictoffset*/
21091  __pyx_pw_18BoundaryConditions_17BoundaryCondition_1__init__, /*tp_init*/
21092  0, /*tp_alloc*/
21093  __pyx_tp_new_18BoundaryConditions_BoundaryCondition, /*tp_new*/
21094  0, /*tp_free*/
21095  0, /*tp_is_gc*/
21096  0, /*tp_bases*/
21097  0, /*tp_mro*/
21098  0, /*tp_cache*/
21099  0, /*tp_subclasses*/
21100  0, /*tp_weaklist*/
21101  0, /*tp_del*/
21102  0, /*tp_version_tag*/
21103  #if PY_VERSION_HEX >= 0x030400a1
21104  0, /*tp_finalize*/
21105  #endif
21106 };
21107 
21108 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[8];
21109 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC = 0;
21110 
21111 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21112  PyObject *o;
21113  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21114  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC];
21115  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC));
21116  (void) PyObject_INIT(o, t);
21117  PyObject_GC_Track(o);
21118  } else {
21119  o = (*t->tp_alloc)(t, 0);
21120  if (unlikely(!o)) return 0;
21121  }
21122  return o;
21123 }
21124 
21125 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21126  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21127  PyObject_GC_UnTrack(o);
21128  Py_CLEAR(p->__pyx_v_value);
21129  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC)))) {
21130  __pyx_freelist_18BoundaryConditions___pyx_scope_struct__setConstantBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct__setConstantBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o);
21131  } else {
21132  (*Py_TYPE(o)->tp_free)(o);
21133  }
21134 }
21135 
21136 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o, visitproc v, void *a) {
21137  int e;
21138  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21139  if (p->__pyx_v_value) {
21140  e = (*v)(p->__pyx_v_value, a); if (e) return e;
21141  }
21142  return 0;
21143 }
21144 
21145 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC(PyObject *o) {
21146  PyObject* tmp;
21147  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC *)o;
21148  tmp = ((PyObject*)p->__pyx_v_value);
21149  p->__pyx_v_value = Py_None; Py_INCREF(Py_None);
21150  Py_XDECREF(tmp);
21151  return 0;
21152 }
21153 
21154 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC = {
21155  PyVarObject_HEAD_INIT(0, 0)
21156  "BoundaryConditions.__pyx_scope_struct__setConstantBC", /*tp_name*/
21157  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct__setConstantBC), /*tp_basicsize*/
21158  0, /*tp_itemsize*/
21159  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_dealloc*/
21160  0, /*tp_print*/
21161  0, /*tp_getattr*/
21162  0, /*tp_setattr*/
21163  #if PY_MAJOR_VERSION < 3
21164  0, /*tp_compare*/
21165  #endif
21166  #if PY_MAJOR_VERSION >= 3
21167  0, /*tp_as_async*/
21168  #endif
21169  0, /*tp_repr*/
21170  0, /*tp_as_number*/
21171  0, /*tp_as_sequence*/
21172  0, /*tp_as_mapping*/
21173  0, /*tp_hash*/
21174  0, /*tp_call*/
21175  0, /*tp_str*/
21176  0, /*tp_getattro*/
21177  0, /*tp_setattro*/
21178  0, /*tp_as_buffer*/
21179  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21180  0, /*tp_doc*/
21181  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_traverse*/
21182  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_clear*/
21183  0, /*tp_richcompare*/
21184  0, /*tp_weaklistoffset*/
21185  0, /*tp_iter*/
21186  0, /*tp_iternext*/
21187  0, /*tp_methods*/
21188  0, /*tp_members*/
21189  0, /*tp_getset*/
21190  0, /*tp_base*/
21191  0, /*tp_dict*/
21192  0, /*tp_descr_get*/
21193  0, /*tp_descr_set*/
21194  0, /*tp_dictoffset*/
21195  0, /*tp_init*/
21196  0, /*tp_alloc*/
21197  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct__setConstantBC, /*tp_new*/
21198  0, /*tp_free*/
21199  0, /*tp_is_gc*/
21200  0, /*tp_bases*/
21201  0, /*tp_mro*/
21202  0, /*tp_cache*/
21203  0, /*tp_subclasses*/
21204  0, /*tp_weaklist*/
21205  0, /*tp_del*/
21206  0, /*tp_version_tag*/
21207  #if PY_VERSION_HEX >= 0x030400a1
21208  0, /*tp_finalize*/
21209  #endif
21210 };
21211 
21212 static struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[8];
21213 static int __pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = 0;
21214 
21215 static PyObject *__pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21216  PyObject *o;
21217  if (CYTHON_COMPILING_IN_CPYTHON && likely((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC > 0) & (t->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21218  o = (PyObject*)__pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[--__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC];
21219  memset(o, 0, sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC));
21220  (void) PyObject_INIT(o, t);
21221  PyObject_GC_Track(o);
21222  } else {
21223  o = (*t->tp_alloc)(t, 0);
21224  if (unlikely(!o)) return 0;
21225  }
21226  return o;
21227 }
21228 
21229 static void __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21230  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21231  PyObject_GC_UnTrack(o);
21232  Py_CLEAR(p->__pyx_v_a0);
21233  Py_CLEAR(p->__pyx_v_a1);
21234  Py_CLEAR(p->__pyx_v_i);
21235  if (CYTHON_COMPILING_IN_CPYTHON && ((__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC < 8) & (Py_TYPE(o)->tp_basicsize == sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC)))) {
21236  __pyx_freelist_18BoundaryConditions___pyx_scope_struct_1_setLinearBC[__pyx_freecount_18BoundaryConditions___pyx_scope_struct_1_setLinearBC++] = ((struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o);
21237  } else {
21238  (*Py_TYPE(o)->tp_free)(o);
21239  }
21240 }
21241 
21242 static int __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o, visitproc v, void *a) {
21243  int e;
21244  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21245  if (p->__pyx_v_a0) {
21246  e = (*v)(p->__pyx_v_a0, a); if (e) return e;
21247  }
21248  if (p->__pyx_v_a1) {
21249  e = (*v)(p->__pyx_v_a1, a); if (e) return e;
21250  }
21251  if (p->__pyx_v_i) {
21252  e = (*v)(p->__pyx_v_i, a); if (e) return e;
21253  }
21254  return 0;
21255 }
21256 
21257 static int __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC(PyObject *o) {
21258  PyObject* tmp;
21259  struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *p = (struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC *)o;
21260  tmp = ((PyObject*)p->__pyx_v_a0);
21261  p->__pyx_v_a0 = Py_None; Py_INCREF(Py_None);
21262  Py_XDECREF(tmp);
21263  tmp = ((PyObject*)p->__pyx_v_a1);
21264  p->__pyx_v_a1 = Py_None; Py_INCREF(Py_None);
21265  Py_XDECREF(tmp);
21266  tmp = ((PyObject*)p->__pyx_v_i);
21267  p->__pyx_v_i = Py_None; Py_INCREF(Py_None);
21268  Py_XDECREF(tmp);
21269  return 0;
21270 }
21271 
21272 static PyTypeObject __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = {
21273  PyVarObject_HEAD_INIT(0, 0)
21274  "BoundaryConditions.__pyx_scope_struct_1_setLinearBC", /*tp_name*/
21275  sizeof(struct __pyx_obj_18BoundaryConditions___pyx_scope_struct_1_setLinearBC), /*tp_basicsize*/
21276  0, /*tp_itemsize*/
21277  __pyx_tp_dealloc_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_dealloc*/
21278  0, /*tp_print*/
21279  0, /*tp_getattr*/
21280  0, /*tp_setattr*/
21281  #if PY_MAJOR_VERSION < 3
21282  0, /*tp_compare*/
21283  #endif
21284  #if PY_MAJOR_VERSION >= 3
21285  0, /*tp_as_async*/
21286  #endif
21287  0, /*tp_repr*/
21288  0, /*tp_as_number*/
21289  0, /*tp_as_sequence*/
21290  0, /*tp_as_mapping*/
21291  0, /*tp_hash*/
21292  0, /*tp_call*/
21293  0, /*tp_str*/
21294  0, /*tp_getattro*/
21295  0, /*tp_setattro*/
21296  0, /*tp_as_buffer*/
21297  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21298  0, /*tp_doc*/
21299  __pyx_tp_traverse_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_traverse*/
21300  __pyx_tp_clear_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_clear*/
21301  0, /*tp_richcompare*/
21302  0, /*tp_weaklistoffset*/
21303  0, /*tp_iter*/
21304  0, /*tp_iternext*/
21305  0, /*tp_methods*/
21306  0, /*tp_members*/
21307  0, /*tp_getset*/
21308  0, /*tp_base*/
21309  0, /*tp_dict*/
21310  0, /*tp_descr_get*/
21311  0, /*tp_descr_set*/
21312  0, /*tp_dictoffset*/
21313  0, /*tp_init*/
21314  0, /*tp_alloc*/
21315  __pyx_tp_new_18BoundaryConditions___pyx_scope_struct_1_setLinearBC, /*tp_new*/
21316  0, /*tp_free*/
21317  0, /*tp_is_gc*/
21318  0, /*tp_bases*/
21319  0, /*tp_mro*/
21320  0, /*tp_cache*/
21321  0, /*tp_subclasses*/
21322  0, /*tp_weaklist*/
21323  0, /*tp_del*/
21324  0, /*tp_version_tag*/
21325  #if PY_VERSION_HEX >= 0x030400a1
21326  0, /*tp_finalize*/
21327  #endif
21328 };
21329 static struct __pyx_vtabstruct_array __pyx_vtable_array;
21330 
21331 static PyObject *__pyx_tp_new_array(PyTypeObject *t, PyObject *a, PyObject *k) {
21332  struct __pyx_array_obj *p;
21333  PyObject *o;
21334  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21335  o = (*t->tp_alloc)(t, 0);
21336  } else {
21337  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21338  }
21339  if (unlikely(!o)) return 0;
21340  p = ((struct __pyx_array_obj *)o);
21341  p->__pyx_vtab = __pyx_vtabptr_array;
21342  p->mode = ((PyObject*)Py_None); Py_INCREF(Py_None);
21343  p->_format = ((PyObject*)Py_None); Py_INCREF(Py_None);
21344  if (unlikely(__pyx_array___cinit__(o, a, k) < 0)) goto bad;
21345  return o;
21346  bad:
21347  Py_DECREF(o); o = 0;
21348  return NULL;
21349 }
21350 
21351 static void __pyx_tp_dealloc_array(PyObject *o) {
21352  struct __pyx_array_obj *p = (struct __pyx_array_obj *)o;
21353  #if CYTHON_USE_TP_FINALIZE
21354  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && (!PyType_IS_GC(Py_TYPE(o)) || !_PyGC_FINALIZED(o))) {
21355  if (PyObject_CallFinalizerFromDealloc(o)) return;
21356  }
21357  #endif
21358  {
21359  PyObject *etype, *eval, *etb;
21360  PyErr_Fetch(&etype, &eval, &etb);
21361  ++Py_REFCNT(o);
21362  __pyx_array___dealloc__(o);
21363  --Py_REFCNT(o);
21364  PyErr_Restore(etype, eval, etb);
21365  }
21366  Py_CLEAR(p->mode);
21367  Py_CLEAR(p->_format);
21368  (*Py_TYPE(o)->tp_free)(o);
21369 }
21370 static PyObject *__pyx_sq_item_array(PyObject *o, Py_ssize_t i) {
21371  PyObject *r;
21372  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21373  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21374  Py_DECREF(x);
21375  return r;
21376 }
21377 
21378 static int __pyx_mp_ass_subscript_array(PyObject *o, PyObject *i, PyObject *v) {
21379  if (v) {
21380  return __pyx_array___setitem__(o, i, v);
21381  }
21382  else {
21383  PyErr_Format(PyExc_NotImplementedError,
21384  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21385  return -1;
21386  }
21387 }
21388 
21389 static PyObject *__pyx_tp_getattro_array(PyObject *o, PyObject *n) {
21390  PyObject *v = __Pyx_PyObject_GenericGetAttr(o, n);
21391  if (!v && PyErr_ExceptionMatches(PyExc_AttributeError)) {
21392  PyErr_Clear();
21393  v = __pyx_array___getattr__(o, n);
21394  }
21395  return v;
21396 }
21397 
21398 static PyObject *__pyx_getprop___pyx_array_memview(PyObject *o, CYTHON_UNUSED void *x) {
21399  return __pyx_pw_15View_dot_MemoryView_5array_7memview_1__get__(o);
21400 }
21401 
21402 static PyMethodDef __pyx_methods_array[] = {
21403  {"__getattr__", (PyCFunction)__pyx_array___getattr__, METH_O|METH_COEXIST, 0},
21404  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_array_1__reduce_cython__, METH_NOARGS, 0},
21405  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_array_3__setstate_cython__, METH_O, 0},
21406  {0, 0, 0, 0}
21407 };
21408 
21409 static struct PyGetSetDef __pyx_getsets_array[] = {
21410  {(char *)"memview", __pyx_getprop___pyx_array_memview, 0, (char *)0, 0},
21411  {0, 0, 0, 0, 0}
21412 };
21413 
21414 static PySequenceMethods __pyx_tp_as_sequence_array = {
21415  __pyx_array___len__, /*sq_length*/
21416  0, /*sq_concat*/
21417  0, /*sq_repeat*/
21418  __pyx_sq_item_array, /*sq_item*/
21419  0, /*sq_slice*/
21420  0, /*sq_ass_item*/
21421  0, /*sq_ass_slice*/
21422  0, /*sq_contains*/
21423  0, /*sq_inplace_concat*/
21424  0, /*sq_inplace_repeat*/
21425 };
21426 
21427 static PyMappingMethods __pyx_tp_as_mapping_array = {
21428  __pyx_array___len__, /*mp_length*/
21429  __pyx_array___getitem__, /*mp_subscript*/
21430  __pyx_mp_ass_subscript_array, /*mp_ass_subscript*/
21431 };
21432 
21433 static PyBufferProcs __pyx_tp_as_buffer_array = {
21434  #if PY_MAJOR_VERSION < 3
21435  0, /*bf_getreadbuffer*/
21436  #endif
21437  #if PY_MAJOR_VERSION < 3
21438  0, /*bf_getwritebuffer*/
21439  #endif
21440  #if PY_MAJOR_VERSION < 3
21441  0, /*bf_getsegcount*/
21442  #endif
21443  #if PY_MAJOR_VERSION < 3
21444  0, /*bf_getcharbuffer*/
21445  #endif
21446  __pyx_array_getbuffer, /*bf_getbuffer*/
21447  0, /*bf_releasebuffer*/
21448 };
21449 
21450 static PyTypeObject __pyx_type___pyx_array = {
21451  PyVarObject_HEAD_INIT(0, 0)
21452  "BoundaryConditions.array", /*tp_name*/
21453  sizeof(struct __pyx_array_obj), /*tp_basicsize*/
21454  0, /*tp_itemsize*/
21455  __pyx_tp_dealloc_array, /*tp_dealloc*/
21456  0, /*tp_print*/
21457  0, /*tp_getattr*/
21458  0, /*tp_setattr*/
21459  #if PY_MAJOR_VERSION < 3
21460  0, /*tp_compare*/
21461  #endif
21462  #if PY_MAJOR_VERSION >= 3
21463  0, /*tp_as_async*/
21464  #endif
21465  0, /*tp_repr*/
21466  0, /*tp_as_number*/
21467  &__pyx_tp_as_sequence_array, /*tp_as_sequence*/
21468  &__pyx_tp_as_mapping_array, /*tp_as_mapping*/
21469  0, /*tp_hash*/
21470  0, /*tp_call*/
21471  0, /*tp_str*/
21472  __pyx_tp_getattro_array, /*tp_getattro*/
21473  0, /*tp_setattro*/
21474  &__pyx_tp_as_buffer_array, /*tp_as_buffer*/
21475  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE, /*tp_flags*/
21476  0, /*tp_doc*/
21477  0, /*tp_traverse*/
21478  0, /*tp_clear*/
21479  0, /*tp_richcompare*/
21480  0, /*tp_weaklistoffset*/
21481  0, /*tp_iter*/
21482  0, /*tp_iternext*/
21483  __pyx_methods_array, /*tp_methods*/
21484  0, /*tp_members*/
21485  __pyx_getsets_array, /*tp_getset*/
21486  0, /*tp_base*/
21487  0, /*tp_dict*/
21488  0, /*tp_descr_get*/
21489  0, /*tp_descr_set*/
21490  0, /*tp_dictoffset*/
21491  0, /*tp_init*/
21492  0, /*tp_alloc*/
21493  __pyx_tp_new_array, /*tp_new*/
21494  0, /*tp_free*/
21495  0, /*tp_is_gc*/
21496  0, /*tp_bases*/
21497  0, /*tp_mro*/
21498  0, /*tp_cache*/
21499  0, /*tp_subclasses*/
21500  0, /*tp_weaklist*/
21501  0, /*tp_del*/
21502  0, /*tp_version_tag*/
21503  #if PY_VERSION_HEX >= 0x030400a1
21504  0, /*tp_finalize*/
21505  #endif
21506 };
21507 
21508 static PyObject *__pyx_tp_new_Enum(PyTypeObject *t, CYTHON_UNUSED PyObject *a, CYTHON_UNUSED PyObject *k) {
21509  struct __pyx_MemviewEnum_obj *p;
21510  PyObject *o;
21511  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21512  o = (*t->tp_alloc)(t, 0);
21513  } else {
21514  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21515  }
21516  if (unlikely(!o)) return 0;
21517  p = ((struct __pyx_MemviewEnum_obj *)o);
21518  p->name = Py_None; Py_INCREF(Py_None);
21519  return o;
21520 }
21521 
21522 static void __pyx_tp_dealloc_Enum(PyObject *o) {
21523  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21524  #if CYTHON_USE_TP_FINALIZE
21525  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21526  if (PyObject_CallFinalizerFromDealloc(o)) return;
21527  }
21528  #endif
21529  PyObject_GC_UnTrack(o);
21530  Py_CLEAR(p->name);
21531  (*Py_TYPE(o)->tp_free)(o);
21532 }
21533 
21534 static int __pyx_tp_traverse_Enum(PyObject *o, visitproc v, void *a) {
21535  int e;
21536  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21537  if (p->name) {
21538  e = (*v)(p->name, a); if (e) return e;
21539  }
21540  return 0;
21541 }
21542 
21543 static int __pyx_tp_clear_Enum(PyObject *o) {
21544  PyObject* tmp;
21545  struct __pyx_MemviewEnum_obj *p = (struct __pyx_MemviewEnum_obj *)o;
21546  tmp = ((PyObject*)p->name);
21547  p->name = Py_None; Py_INCREF(Py_None);
21548  Py_XDECREF(tmp);
21549  return 0;
21550 }
21551 
21552 static PyMethodDef __pyx_methods_Enum[] = {
21553  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_1__reduce_cython__, METH_NOARGS, 0},
21554  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_MemviewEnum_3__setstate_cython__, METH_O, 0},
21555  {0, 0, 0, 0}
21556 };
21557 
21558 static PyTypeObject __pyx_type___pyx_MemviewEnum = {
21559  PyVarObject_HEAD_INIT(0, 0)
21560  "BoundaryConditions.Enum", /*tp_name*/
21561  sizeof(struct __pyx_MemviewEnum_obj), /*tp_basicsize*/
21562  0, /*tp_itemsize*/
21563  __pyx_tp_dealloc_Enum, /*tp_dealloc*/
21564  0, /*tp_print*/
21565  0, /*tp_getattr*/
21566  0, /*tp_setattr*/
21567  #if PY_MAJOR_VERSION < 3
21568  0, /*tp_compare*/
21569  #endif
21570  #if PY_MAJOR_VERSION >= 3
21571  0, /*tp_as_async*/
21572  #endif
21573  __pyx_MemviewEnum___repr__, /*tp_repr*/
21574  0, /*tp_as_number*/
21575  0, /*tp_as_sequence*/
21576  0, /*tp_as_mapping*/
21577  0, /*tp_hash*/
21578  0, /*tp_call*/
21579  0, /*tp_str*/
21580  0, /*tp_getattro*/
21581  0, /*tp_setattro*/
21582  0, /*tp_as_buffer*/
21583  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21584  0, /*tp_doc*/
21585  __pyx_tp_traverse_Enum, /*tp_traverse*/
21586  __pyx_tp_clear_Enum, /*tp_clear*/
21587  0, /*tp_richcompare*/
21588  0, /*tp_weaklistoffset*/
21589  0, /*tp_iter*/
21590  0, /*tp_iternext*/
21591  __pyx_methods_Enum, /*tp_methods*/
21592  0, /*tp_members*/
21593  0, /*tp_getset*/
21594  0, /*tp_base*/
21595  0, /*tp_dict*/
21596  0, /*tp_descr_get*/
21597  0, /*tp_descr_set*/
21598  0, /*tp_dictoffset*/
21599  __pyx_MemviewEnum___init__, /*tp_init*/
21600  0, /*tp_alloc*/
21601  __pyx_tp_new_Enum, /*tp_new*/
21602  0, /*tp_free*/
21603  0, /*tp_is_gc*/
21604  0, /*tp_bases*/
21605  0, /*tp_mro*/
21606  0, /*tp_cache*/
21607  0, /*tp_subclasses*/
21608  0, /*tp_weaklist*/
21609  0, /*tp_del*/
21610  0, /*tp_version_tag*/
21611  #if PY_VERSION_HEX >= 0x030400a1
21612  0, /*tp_finalize*/
21613  #endif
21614 };
21615 static struct __pyx_vtabstruct_memoryview __pyx_vtable_memoryview;
21616 
21617 static PyObject *__pyx_tp_new_memoryview(PyTypeObject *t, PyObject *a, PyObject *k) {
21618  struct __pyx_memoryview_obj *p;
21619  PyObject *o;
21620  if (likely((t->tp_flags & Py_TPFLAGS_IS_ABSTRACT) == 0)) {
21621  o = (*t->tp_alloc)(t, 0);
21622  } else {
21623  o = (PyObject *) PyBaseObject_Type.tp_new(t, __pyx_empty_tuple, 0);
21624  }
21625  if (unlikely(!o)) return 0;
21626  p = ((struct __pyx_memoryview_obj *)o);
21627  p->__pyx_vtab = __pyx_vtabptr_memoryview;
21628  p->obj = Py_None; Py_INCREF(Py_None);
21629  p->_size = Py_None; Py_INCREF(Py_None);
21630  p->_array_interface = Py_None; Py_INCREF(Py_None);
21631  p->view.obj = NULL;
21632  if (unlikely(__pyx_memoryview___cinit__(o, a, k) < 0)) goto bad;
21633  return o;
21634  bad:
21635  Py_DECREF(o); o = 0;
21636  return NULL;
21637 }
21638 
21639 static void __pyx_tp_dealloc_memoryview(PyObject *o) {
21640  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21641  #if CYTHON_USE_TP_FINALIZE
21642  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21643  if (PyObject_CallFinalizerFromDealloc(o)) return;
21644  }
21645  #endif
21646  PyObject_GC_UnTrack(o);
21647  {
21648  PyObject *etype, *eval, *etb;
21649  PyErr_Fetch(&etype, &eval, &etb);
21650  ++Py_REFCNT(o);
21651  __pyx_memoryview___dealloc__(o);
21652  --Py_REFCNT(o);
21653  PyErr_Restore(etype, eval, etb);
21654  }
21655  Py_CLEAR(p->obj);
21656  Py_CLEAR(p->_size);
21657  Py_CLEAR(p->_array_interface);
21658  (*Py_TYPE(o)->tp_free)(o);
21659 }
21660 
21661 static int __pyx_tp_traverse_memoryview(PyObject *o, visitproc v, void *a) {
21662  int e;
21663  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21664  if (p->obj) {
21665  e = (*v)(p->obj, a); if (e) return e;
21666  }
21667  if (p->_size) {
21668  e = (*v)(p->_size, a); if (e) return e;
21669  }
21670  if (p->_array_interface) {
21671  e = (*v)(p->_array_interface, a); if (e) return e;
21672  }
21673  if (p->view.obj) {
21674  e = (*v)(p->view.obj, a); if (e) return e;
21675  }
21676  return 0;
21677 }
21678 
21679 static int __pyx_tp_clear_memoryview(PyObject *o) {
21680  PyObject* tmp;
21681  struct __pyx_memoryview_obj *p = (struct __pyx_memoryview_obj *)o;
21682  tmp = ((PyObject*)p->obj);
21683  p->obj = Py_None; Py_INCREF(Py_None);
21684  Py_XDECREF(tmp);
21685  tmp = ((PyObject*)p->_size);
21686  p->_size = Py_None; Py_INCREF(Py_None);
21687  Py_XDECREF(tmp);
21688  tmp = ((PyObject*)p->_array_interface);
21689  p->_array_interface = Py_None; Py_INCREF(Py_None);
21690  Py_XDECREF(tmp);
21691  Py_CLEAR(p->view.obj);
21692  return 0;
21693 }
21694 static PyObject *__pyx_sq_item_memoryview(PyObject *o, Py_ssize_t i) {
21695  PyObject *r;
21696  PyObject *x = PyInt_FromSsize_t(i); if(!x) return 0;
21697  r = Py_TYPE(o)->tp_as_mapping->mp_subscript(o, x);
21698  Py_DECREF(x);
21699  return r;
21700 }
21701 
21702 static int __pyx_mp_ass_subscript_memoryview(PyObject *o, PyObject *i, PyObject *v) {
21703  if (v) {
21704  return __pyx_memoryview___setitem__(o, i, v);
21705  }
21706  else {
21707  PyErr_Format(PyExc_NotImplementedError,
21708  "Subscript deletion not supported by %.200s", Py_TYPE(o)->tp_name);
21709  return -1;
21710  }
21711 }
21712 
21713 static PyObject *__pyx_getprop___pyx_memoryview_T(PyObject *o, CYTHON_UNUSED void *x) {
21714  return __pyx_pw_15View_dot_MemoryView_10memoryview_1T_1__get__(o);
21715 }
21716 
21717 static PyObject *__pyx_getprop___pyx_memoryview_base(PyObject *o, CYTHON_UNUSED void *x) {
21718  return __pyx_pw_15View_dot_MemoryView_10memoryview_4base_1__get__(o);
21719 }
21720 
21721 static PyObject *__pyx_getprop___pyx_memoryview_shape(PyObject *o, CYTHON_UNUSED void *x) {
21722  return __pyx_pw_15View_dot_MemoryView_10memoryview_5shape_1__get__(o);
21723 }
21724 
21725 static PyObject *__pyx_getprop___pyx_memoryview_strides(PyObject *o, CYTHON_UNUSED void *x) {
21726  return __pyx_pw_15View_dot_MemoryView_10memoryview_7strides_1__get__(o);
21727 }
21728 
21729 static PyObject *__pyx_getprop___pyx_memoryview_suboffsets(PyObject *o, CYTHON_UNUSED void *x) {
21730  return __pyx_pw_15View_dot_MemoryView_10memoryview_10suboffsets_1__get__(o);
21731 }
21732 
21733 static PyObject *__pyx_getprop___pyx_memoryview_ndim(PyObject *o, CYTHON_UNUSED void *x) {
21734  return __pyx_pw_15View_dot_MemoryView_10memoryview_4ndim_1__get__(o);
21735 }
21736 
21737 static PyObject *__pyx_getprop___pyx_memoryview_itemsize(PyObject *o, CYTHON_UNUSED void *x) {
21738  return __pyx_pw_15View_dot_MemoryView_10memoryview_8itemsize_1__get__(o);
21739 }
21740 
21741 static PyObject *__pyx_getprop___pyx_memoryview_nbytes(PyObject *o, CYTHON_UNUSED void *x) {
21742  return __pyx_pw_15View_dot_MemoryView_10memoryview_6nbytes_1__get__(o);
21743 }
21744 
21745 static PyObject *__pyx_getprop___pyx_memoryview_size(PyObject *o, CYTHON_UNUSED void *x) {
21746  return __pyx_pw_15View_dot_MemoryView_10memoryview_4size_1__get__(o);
21747 }
21748 
21749 static PyMethodDef __pyx_methods_memoryview[] = {
21750  {"is_c_contig", (PyCFunction)__pyx_memoryview_is_c_contig, METH_NOARGS, 0},
21751  {"is_f_contig", (PyCFunction)__pyx_memoryview_is_f_contig, METH_NOARGS, 0},
21752  {"copy", (PyCFunction)__pyx_memoryview_copy, METH_NOARGS, 0},
21753  {"copy_fortran", (PyCFunction)__pyx_memoryview_copy_fortran, METH_NOARGS, 0},
21754  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_1__reduce_cython__, METH_NOARGS, 0},
21755  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryview_3__setstate_cython__, METH_O, 0},
21756  {0, 0, 0, 0}
21757 };
21758 
21759 static struct PyGetSetDef __pyx_getsets_memoryview[] = {
21760  {(char *)"T", __pyx_getprop___pyx_memoryview_T, 0, (char *)0, 0},
21761  {(char *)"base", __pyx_getprop___pyx_memoryview_base, 0, (char *)0, 0},
21762  {(char *)"shape", __pyx_getprop___pyx_memoryview_shape, 0, (char *)0, 0},
21763  {(char *)"strides", __pyx_getprop___pyx_memoryview_strides, 0, (char *)0, 0},
21764  {(char *)"suboffsets", __pyx_getprop___pyx_memoryview_suboffsets, 0, (char *)0, 0},
21765  {(char *)"ndim", __pyx_getprop___pyx_memoryview_ndim, 0, (char *)0, 0},
21766  {(char *)"itemsize", __pyx_getprop___pyx_memoryview_itemsize, 0, (char *)0, 0},
21767  {(char *)"nbytes", __pyx_getprop___pyx_memoryview_nbytes, 0, (char *)0, 0},
21768  {(char *)"size", __pyx_getprop___pyx_memoryview_size, 0, (char *)0, 0},
21769  {0, 0, 0, 0, 0}
21770 };
21771 
21772 static PySequenceMethods __pyx_tp_as_sequence_memoryview = {
21773  __pyx_memoryview___len__, /*sq_length*/
21774  0, /*sq_concat*/
21775  0, /*sq_repeat*/
21776  __pyx_sq_item_memoryview, /*sq_item*/
21777  0, /*sq_slice*/
21778  0, /*sq_ass_item*/
21779  0, /*sq_ass_slice*/
21780  0, /*sq_contains*/
21781  0, /*sq_inplace_concat*/
21782  0, /*sq_inplace_repeat*/
21783 };
21784 
21785 static PyMappingMethods __pyx_tp_as_mapping_memoryview = {
21786  __pyx_memoryview___len__, /*mp_length*/
21787  __pyx_memoryview___getitem__, /*mp_subscript*/
21788  __pyx_mp_ass_subscript_memoryview, /*mp_ass_subscript*/
21789 };
21790 
21791 static PyBufferProcs __pyx_tp_as_buffer_memoryview = {
21792  #if PY_MAJOR_VERSION < 3
21793  0, /*bf_getreadbuffer*/
21794  #endif
21795  #if PY_MAJOR_VERSION < 3
21796  0, /*bf_getwritebuffer*/
21797  #endif
21798  #if PY_MAJOR_VERSION < 3
21799  0, /*bf_getsegcount*/
21800  #endif
21801  #if PY_MAJOR_VERSION < 3
21802  0, /*bf_getcharbuffer*/
21803  #endif
21804  __pyx_memoryview_getbuffer, /*bf_getbuffer*/
21805  0, /*bf_releasebuffer*/
21806 };
21807 
21808 static PyTypeObject __pyx_type___pyx_memoryview = {
21809  PyVarObject_HEAD_INIT(0, 0)
21810  "BoundaryConditions.memoryview", /*tp_name*/
21811  sizeof(struct __pyx_memoryview_obj), /*tp_basicsize*/
21812  0, /*tp_itemsize*/
21813  __pyx_tp_dealloc_memoryview, /*tp_dealloc*/
21814  0, /*tp_print*/
21815  0, /*tp_getattr*/
21816  0, /*tp_setattr*/
21817  #if PY_MAJOR_VERSION < 3
21818  0, /*tp_compare*/
21819  #endif
21820  #if PY_MAJOR_VERSION >= 3
21821  0, /*tp_as_async*/
21822  #endif
21823  __pyx_memoryview___repr__, /*tp_repr*/
21824  0, /*tp_as_number*/
21825  &__pyx_tp_as_sequence_memoryview, /*tp_as_sequence*/
21826  &__pyx_tp_as_mapping_memoryview, /*tp_as_mapping*/
21827  0, /*tp_hash*/
21828  0, /*tp_call*/
21829  __pyx_memoryview___str__, /*tp_str*/
21830  0, /*tp_getattro*/
21831  0, /*tp_setattro*/
21832  &__pyx_tp_as_buffer_memoryview, /*tp_as_buffer*/
21833  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21834  0, /*tp_doc*/
21835  __pyx_tp_traverse_memoryview, /*tp_traverse*/
21836  __pyx_tp_clear_memoryview, /*tp_clear*/
21837  0, /*tp_richcompare*/
21838  0, /*tp_weaklistoffset*/
21839  0, /*tp_iter*/
21840  0, /*tp_iternext*/
21841  __pyx_methods_memoryview, /*tp_methods*/
21842  0, /*tp_members*/
21843  __pyx_getsets_memoryview, /*tp_getset*/
21844  0, /*tp_base*/
21845  0, /*tp_dict*/
21846  0, /*tp_descr_get*/
21847  0, /*tp_descr_set*/
21848  0, /*tp_dictoffset*/
21849  0, /*tp_init*/
21850  0, /*tp_alloc*/
21851  __pyx_tp_new_memoryview, /*tp_new*/
21852  0, /*tp_free*/
21853  0, /*tp_is_gc*/
21854  0, /*tp_bases*/
21855  0, /*tp_mro*/
21856  0, /*tp_cache*/
21857  0, /*tp_subclasses*/
21858  0, /*tp_weaklist*/
21859  0, /*tp_del*/
21860  0, /*tp_version_tag*/
21861  #if PY_VERSION_HEX >= 0x030400a1
21862  0, /*tp_finalize*/
21863  #endif
21864 };
21865 static struct __pyx_vtabstruct__memoryviewslice __pyx_vtable__memoryviewslice;
21866 
21867 static PyObject *__pyx_tp_new__memoryviewslice(PyTypeObject *t, PyObject *a, PyObject *k) {
21868  struct __pyx_memoryviewslice_obj *p;
21869  PyObject *o = __pyx_tp_new_memoryview(t, a, k);
21870  if (unlikely(!o)) return 0;
21871  p = ((struct __pyx_memoryviewslice_obj *)o);
21872  p->__pyx_base.__pyx_vtab = (struct __pyx_vtabstruct_memoryview*)__pyx_vtabptr__memoryviewslice;
21873  p->from_object = Py_None; Py_INCREF(Py_None);
21874  p->from_slice.memview = NULL;
21875  return o;
21876 }
21877 
21878 static void __pyx_tp_dealloc__memoryviewslice(PyObject *o) {
21879  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21880  #if CYTHON_USE_TP_FINALIZE
21881  if (unlikely(PyType_HasFeature(Py_TYPE(o), Py_TPFLAGS_HAVE_FINALIZE) && Py_TYPE(o)->tp_finalize) && !_PyGC_FINALIZED(o)) {
21882  if (PyObject_CallFinalizerFromDealloc(o)) return;
21883  }
21884  #endif
21885  PyObject_GC_UnTrack(o);
21886  {
21887  PyObject *etype, *eval, *etb;
21888  PyErr_Fetch(&etype, &eval, &etb);
21889  ++Py_REFCNT(o);
21890  __pyx_memoryviewslice___dealloc__(o);
21891  --Py_REFCNT(o);
21892  PyErr_Restore(etype, eval, etb);
21893  }
21894  Py_CLEAR(p->from_object);
21895  PyObject_GC_Track(o);
21896  __pyx_tp_dealloc_memoryview(o);
21897 }
21898 
21899 static int __pyx_tp_traverse__memoryviewslice(PyObject *o, visitproc v, void *a) {
21900  int e;
21901  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21902  e = __pyx_tp_traverse_memoryview(o, v, a); if (e) return e;
21903  if (p->from_object) {
21904  e = (*v)(p->from_object, a); if (e) return e;
21905  }
21906  return 0;
21907 }
21908 
21909 static int __pyx_tp_clear__memoryviewslice(PyObject *o) {
21910  PyObject* tmp;
21911  struct __pyx_memoryviewslice_obj *p = (struct __pyx_memoryviewslice_obj *)o;
21912  __pyx_tp_clear_memoryview(o);
21913  tmp = ((PyObject*)p->from_object);
21914  p->from_object = Py_None; Py_INCREF(Py_None);
21915  Py_XDECREF(tmp);
21916  __PYX_XDEC_MEMVIEW(&p->from_slice, 1);
21917  return 0;
21918 }
21919 
21920 static PyObject *__pyx_getprop___pyx_memoryviewslice_base(PyObject *o, CYTHON_UNUSED void *x) {
21921  return __pyx_pw_15View_dot_MemoryView_16_memoryviewslice_4base_1__get__(o);
21922 }
21923 
21924 static PyMethodDef __pyx_methods__memoryviewslice[] = {
21925  {"__reduce_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_1__reduce_cython__, METH_NOARGS, 0},
21926  {"__setstate_cython__", (PyCFunction)__pyx_pw___pyx_memoryviewslice_3__setstate_cython__, METH_O, 0},
21927  {0, 0, 0, 0}
21928 };
21929 
21930 static struct PyGetSetDef __pyx_getsets__memoryviewslice[] = {
21931  {(char *)"base", __pyx_getprop___pyx_memoryviewslice_base, 0, (char *)0, 0},
21932  {0, 0, 0, 0, 0}
21933 };
21934 
21935 static PyTypeObject __pyx_type___pyx_memoryviewslice = {
21936  PyVarObject_HEAD_INIT(0, 0)
21937  "BoundaryConditions._memoryviewslice", /*tp_name*/
21938  sizeof(struct __pyx_memoryviewslice_obj), /*tp_basicsize*/
21939  0, /*tp_itemsize*/
21940  __pyx_tp_dealloc__memoryviewslice, /*tp_dealloc*/
21941  0, /*tp_print*/
21942  0, /*tp_getattr*/
21943  0, /*tp_setattr*/
21944  #if PY_MAJOR_VERSION < 3
21945  0, /*tp_compare*/
21946  #endif
21947  #if PY_MAJOR_VERSION >= 3
21948  0, /*tp_as_async*/
21949  #endif
21950  #if CYTHON_COMPILING_IN_PYPY
21951  __pyx_memoryview___repr__, /*tp_repr*/
21952  #else
21953  0, /*tp_repr*/
21954  #endif
21955  0, /*tp_as_number*/
21956  0, /*tp_as_sequence*/
21957  0, /*tp_as_mapping*/
21958  0, /*tp_hash*/
21959  0, /*tp_call*/
21960  #if CYTHON_COMPILING_IN_PYPY
21961  __pyx_memoryview___str__, /*tp_str*/
21962  #else
21963  0, /*tp_str*/
21964  #endif
21965  0, /*tp_getattro*/
21966  0, /*tp_setattro*/
21967  0, /*tp_as_buffer*/
21968  Py_TPFLAGS_DEFAULT|Py_TPFLAGS_HAVE_VERSION_TAG|Py_TPFLAGS_CHECKTYPES|Py_TPFLAGS_HAVE_NEWBUFFER|Py_TPFLAGS_BASETYPE|Py_TPFLAGS_HAVE_GC, /*tp_flags*/
21969  "Internal class for passing memoryview slices to Python", /*tp_doc*/
21970  __pyx_tp_traverse__memoryviewslice, /*tp_traverse*/
21971  __pyx_tp_clear__memoryviewslice, /*tp_clear*/
21972  0, /*tp_richcompare*/
21973  0, /*tp_weaklistoffset*/
21974  0, /*tp_iter*/
21975  0, /*tp_iternext*/
21976  __pyx_methods__memoryviewslice, /*tp_methods*/
21977  0, /*tp_members*/
21978  __pyx_getsets__memoryviewslice, /*tp_getset*/
21979  0, /*tp_base*/
21980  0, /*tp_dict*/
21981  0, /*tp_descr_get*/
21982  0, /*tp_descr_set*/
21983  0, /*tp_dictoffset*/
21984  0, /*tp_init*/
21985  0, /*tp_alloc*/
21986  __pyx_tp_new__memoryviewslice, /*tp_new*/
21987  0, /*tp_free*/
21988  0, /*tp_is_gc*/
21989  0, /*tp_bases*/
21990  0, /*tp_mro*/
21991  0, /*tp_cache*/
21992  0, /*tp_subclasses*/
21993  0, /*tp_weaklist*/
21994  0, /*tp_del*/
21995  0, /*tp_version_tag*/
21996  #if PY_VERSION_HEX >= 0x030400a1
21997  0, /*tp_finalize*/
21998  #endif
21999 };
22000 
22001 static PyMethodDef __pyx_methods[] = {
22002  {0, 0, 0, 0}
22003 };
22004 
22005 #if PY_MAJOR_VERSION >= 3
22006 #if CYTHON_PEP489_MULTI_PHASE_INIT
22007 static PyObject* __pyx_pymod_create(PyObject *spec, PyModuleDef *def); /*proto*/
22008 static int __pyx_pymod_exec_BoundaryConditions(PyObject* module); /*proto*/
22009 static PyModuleDef_Slot __pyx_moduledef_slots[] = {
22010  {Py_mod_create, (void*)__pyx_pymod_create},
22011  {Py_mod_exec, (void*)__pyx_pymod_exec_BoundaryConditions},
22012  {0, NULL}
22013 };
22014 #endif
22015 
22016 static struct PyModuleDef __pyx_moduledef = {
22017  PyModuleDef_HEAD_INIT,
22018  "BoundaryConditions",
22019  0, /* m_doc */
22020  #if CYTHON_PEP489_MULTI_PHASE_INIT
22021  0, /* m_size */
22022  #else
22023  -1, /* m_size */
22024  #endif
22025  __pyx_methods /* m_methods */,
22026  #if CYTHON_PEP489_MULTI_PHASE_INIT
22027  __pyx_moduledef_slots, /* m_slots */
22028  #else
22029  NULL, /* m_reload */
22030  #endif
22031  NULL, /* m_traverse */
22032  NULL, /* m_clear */
22033  NULL /* m_free */
22034 };
22035 #endif
22036 
22037 static __Pyx_StringTabEntry __pyx_string_tab[] = {
22038  {&__pyx_n_s_ASCII, __pyx_k_ASCII, sizeof(__pyx_k_ASCII), 0, 0, 1, 1},
22039  {&__pyx_n_s_BC_Base___reduce_cython, __pyx_k_BC_Base___reduce_cython, sizeof(__pyx_k_BC_Base___reduce_cython), 0, 0, 1, 1},
22040  {&__pyx_n_s_BC_Base___setstate_cython, __pyx_k_BC_Base___setstate_cython, sizeof(__pyx_k_BC_Base___setstate_cython), 0, 0, 1, 1},
22041  {&__pyx_n_s_BC_Base_getContext, __pyx_k_BC_Base_getContext, sizeof(__pyx_k_BC_Base_getContext), 0, 0, 1, 1},
22042  {&__pyx_n_s_BoundaryCondition___reduce_cytho, __pyx_k_BoundaryCondition___reduce_cytho, sizeof(__pyx_k_BoundaryCondition___reduce_cytho), 0, 0, 1, 1},
22043  {&__pyx_n_s_BoundaryCondition___setstate_cyt, __pyx_k_BoundaryCondition___setstate_cyt, sizeof(__pyx_k_BoundaryCondition___setstate_cyt), 0, 0, 1, 1},
22044  {&__pyx_n_s_BoundaryCondition_init_cython, __pyx_k_BoundaryCondition_init_cython, sizeof(__pyx_k_BoundaryCondition_init_cython), 0, 0, 1, 1},
22045  {&__pyx_n_s_BoundaryCondition_resetBC, __pyx_k_BoundaryCondition_resetBC, sizeof(__pyx_k_BoundaryCondition_resetBC), 0, 0, 1, 1},
22046  {&__pyx_n_s_BoundaryCondition_setConstantBC, __pyx_k_BoundaryCondition_setConstantBC, sizeof(__pyx_k_BoundaryCondition_setConstantBC), 0, 0, 1, 1},
22047  {&__pyx_n_s_BoundaryCondition_setLinearBC, __pyx_k_BoundaryCondition_setLinearBC, sizeof(__pyx_k_BoundaryCondition_setLinearBC), 0, 0, 1, 1},
22048  {&__pyx_n_s_BoundaryConditions, __pyx_k_BoundaryConditions, sizeof(__pyx_k_BoundaryConditions), 0, 0, 1, 1},
22049  {&__pyx_kp_s_Buffer_view_does_not_expose_stri, __pyx_k_Buffer_view_does_not_expose_stri, sizeof(__pyx_k_Buffer_view_does_not_expose_stri), 0, 0, 1, 0},
22050  {&__pyx_kp_s_Can_only_create_a_buffer_that_is, __pyx_k_Can_only_create_a_buffer_that_is, sizeof(__pyx_k_Can_only_create_a_buffer_that_is), 0, 0, 1, 0},
22051  {&__pyx_kp_s_Cannot_assign_to_read_only_memor, __pyx_k_Cannot_assign_to_read_only_memor, sizeof(__pyx_k_Cannot_assign_to_read_only_memor), 0, 0, 1, 0},
22052  {&__pyx_kp_s_Cannot_create_writable_memory_vi, __pyx_k_Cannot_create_writable_memory_vi, sizeof(__pyx_k_Cannot_create_writable_memory_vi), 0, 0, 1, 0},
22053  {&__pyx_kp_s_Cannot_index_with_type_s, __pyx_k_Cannot_index_with_type_s, sizeof(__pyx_k_Cannot_index_with_type_s), 0, 0, 1, 0},
22054  {&__pyx_n_s_Context, __pyx_k_Context, sizeof(__pyx_k_Context), 0, 0, 1, 1},
22055  {&__pyx_n_s_Domain, __pyx_k_Domain, sizeof(__pyx_k_Domain), 0, 0, 1, 1},
22056  {&__pyx_n_s_Ellipsis, __pyx_k_Ellipsis, sizeof(__pyx_k_Ellipsis), 0, 0, 1, 1},
22057  {&__pyx_kp_s_Empty_shape_tuple_for_cython_arr, __pyx_k_Empty_shape_tuple_for_cython_arr, sizeof(__pyx_k_Empty_shape_tuple_for_cython_arr), 0, 0, 1, 0},
22058  {&__pyx_kp_u_Format_string_allocated_too_shor, __pyx_k_Format_string_allocated_too_shor, sizeof(__pyx_k_Format_string_allocated_too_shor), 0, 1, 0, 0},
22059  {&__pyx_kp_u_Format_string_allocated_too_shor_2, __pyx_k_Format_string_allocated_too_shor_2, sizeof(__pyx_k_Format_string_allocated_too_shor_2), 0, 1, 0, 0},
22060  {&__pyx_n_s_ImportError, __pyx_k_ImportError, sizeof(__pyx_k_ImportError), 0, 0, 1, 1},
22061  {&__pyx_kp_s_Incompatible_checksums_s_vs_0x96, __pyx_k_Incompatible_checksums_s_vs_0x96, sizeof(__pyx_k_Incompatible_checksums_s_vs_0x96), 0, 0, 1, 0},
22062  {&__pyx_kp_s_Incompatible_checksums_s_vs_0xb0, __pyx_k_Incompatible_checksums_s_vs_0xb0, sizeof(__pyx_k_Incompatible_checksums_s_vs_0xb0), 0, 0, 1, 0},
22063  {&__pyx_n_s_IndexError, __pyx_k_IndexError, sizeof(__pyx_k_IndexError), 0, 0, 1, 1},
22064  {&__pyx_kp_s_Indirect_dimensions_not_supporte, __pyx_k_Indirect_dimensions_not_supporte, sizeof(__pyx_k_Indirect_dimensions_not_supporte), 0, 0, 1, 0},
22065  {&__pyx_kp_s_Invalid_mode_expected_c_or_fortr, __pyx_k_Invalid_mode_expected_c_or_fortr, sizeof(__pyx_k_Invalid_mode_expected_c_or_fortr), 0, 0, 1, 0},
22066  {&__pyx_kp_s_Invalid_shape_in_axis_d_d, __pyx_k_Invalid_shape_in_axis_d_d, sizeof(__pyx_k_Invalid_shape_in_axis_d_d), 0, 0, 1, 0},
22067  {&__pyx_n_s_MemoryError, __pyx_k_MemoryError, sizeof(__pyx_k_MemoryError), 0, 0, 1, 1},
22068  {&__pyx_kp_s_MemoryView_of_r_at_0x_x, __pyx_k_MemoryView_of_r_at_0x_x, sizeof(__pyx_k_MemoryView_of_r_at_0x_x), 0, 0, 1, 0},
22069  {&__pyx_kp_s_MemoryView_of_r_object, __pyx_k_MemoryView_of_r_object, sizeof(__pyx_k_MemoryView_of_r_object), 0, 0, 1, 0},
22070  {&__pyx_kp_u_Non_native_byte_order_not_suppor, __pyx_k_Non_native_byte_order_not_suppor, sizeof(__pyx_k_Non_native_byte_order_not_suppor), 0, 1, 0, 0},
22071  {&__pyx_n_s_None, __pyx_k_None, sizeof(__pyx_k_None), 0, 0, 1, 1},
22072  {&__pyx_n_b_O, __pyx_k_O, sizeof(__pyx_k_O), 0, 0, 0, 1},
22073  {&__pyx_kp_s_Out_of_bounds_on_buffer_access_a, __pyx_k_Out_of_bounds_on_buffer_access_a, sizeof(__pyx_k_Out_of_bounds_on_buffer_access_a), 0, 0, 1, 0},
22074  {&__pyx_n_s_PickleError, __pyx_k_PickleError, sizeof(__pyx_k_PickleError), 0, 0, 1, 1},
22075  {&__pyx_n_s_RuntimeError, __pyx_k_RuntimeError, sizeof(__pyx_k_RuntimeError), 0, 0, 1, 1},
22076  {&__pyx_kp_s_Shape_or_nd_must_be_passed_to_BC, __pyx_k_Shape_or_nd_must_be_passed_to_BC, sizeof(__pyx_k_Shape_or_nd_must_be_passed_to_BC), 0, 0, 1, 0},
22077  {&__pyx_n_s_TypeError, __pyx_k_TypeError, sizeof(__pyx_k_TypeError), 0, 0, 1, 1},
22078  {&__pyx_kp_s_Unable_to_convert_item_to_object, __pyx_k_Unable_to_convert_item_to_object, sizeof(__pyx_k_Unable_to_convert_item_to_object), 0, 0, 1, 0},
22079  {&__pyx_n_s_ValueError, __pyx_k_ValueError, sizeof(__pyx_k_ValueError), 0, 0, 1, 1},
22080  {&__pyx_n_s_View_MemoryView, __pyx_k_View_MemoryView, sizeof(__pyx_k_View_MemoryView), 0, 0, 1, 1},
22081  {&__pyx_n_s_a0, __pyx_k_a0, sizeof(__pyx_k_a0), 0, 0, 1, 1},
22082  {&__pyx_n_s_a1, __pyx_k_a1, sizeof(__pyx_k_a1), 0, 0, 1, 1},
22083  {&__pyx_n_s_allocate_buffer, __pyx_k_allocate_buffer, sizeof(__pyx_k_allocate_buffer), 0, 0, 1, 1},
22084  {&__pyx_n_s_b_i, __pyx_k_b_i, sizeof(__pyx_k_b_i), 0, 0, 1, 1},
22085  {&__pyx_n_s_b_or, __pyx_k_b_or, sizeof(__pyx_k_b_or), 0, 0, 1, 1},
22086  {&__pyx_n_s_base, __pyx_k_base, sizeof(__pyx_k_base), 0, 0, 1, 1},
22087  {&__pyx_n_s_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 0, 1, 1},
22088  {&__pyx_n_u_c, __pyx_k_c, sizeof(__pyx_k_c), 0, 1, 0, 1},
22089  {&__pyx_n_s_class, __pyx_k_class, sizeof(__pyx_k_class), 0, 0, 1, 1},
22090  {&__pyx_n_s_cline_in_traceback, __pyx_k_cline_in_traceback, sizeof(__pyx_k_cline_in_traceback), 0, 0, 1, 1},
22091  {&__pyx_n_s_context, __pyx_k_context, sizeof(__pyx_k_context), 0, 0, 1, 1},
22092  {&__pyx_kp_s_contiguous_and_direct, __pyx_k_contiguous_and_direct, sizeof(__pyx_k_contiguous_and_direct), 0, 0, 1, 0},
22093  {&__pyx_kp_s_contiguous_and_indirect, __pyx_k_contiguous_and_indirect, sizeof(__pyx_k_contiguous_and_indirect), 0, 0, 1, 0},
22094  {&__pyx_n_s_dict, __pyx_k_dict, sizeof(__pyx_k_dict), 0, 0, 1, 1},
22095  {&__pyx_n_s_dict_2, __pyx_k_dict_2, sizeof(__pyx_k_dict_2), 0, 0, 1, 1},
22096  {&__pyx_n_s_dtype_is_object, __pyx_k_dtype_is_object, sizeof(__pyx_k_dtype_is_object), 0, 0, 1, 1},
22097  {&__pyx_n_s_encode, __pyx_k_encode, sizeof(__pyx_k_encode), 0, 0, 1, 1},
22098  {&__pyx_n_s_enumerate, __pyx_k_enumerate, sizeof(__pyx_k_enumerate), 0, 0, 1, 1},
22099  {&__pyx_n_s_error, __pyx_k_error, sizeof(__pyx_k_error), 0, 0, 1, 1},
22100  {&__pyx_n_s_flags, __pyx_k_flags, sizeof(__pyx_k_flags), 0, 0, 1, 1},
22101  {&__pyx_n_s_format, __pyx_k_format, sizeof(__pyx_k_format), 0, 0, 1, 1},
22102  {&__pyx_n_s_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 0, 1, 1},
22103  {&__pyx_n_u_fortran, __pyx_k_fortran, sizeof(__pyx_k_fortran), 0, 1, 0, 1},
22104  {&__pyx_n_s_get, __pyx_k_get, sizeof(__pyx_k_get), 0, 0, 1, 1},
22105  {&__pyx_n_s_getContext, __pyx_k_getContext, sizeof(__pyx_k_getContext), 0, 0, 1, 1},
22106  {&__pyx_n_s_getstate, __pyx_k_getstate, sizeof(__pyx_k_getstate), 0, 0, 1, 1},
22107  {&__pyx_kp_s_got_differing_extents_in_dimensi, __pyx_k_got_differing_extents_in_dimensi, sizeof(__pyx_k_got_differing_extents_in_dimensi), 0, 0, 1, 0},
22108  {&__pyx_n_s_i, __pyx_k_i, sizeof(__pyx_k_i), 0, 0, 1, 1},
22109  {&__pyx_n_s_id, __pyx_k_id, sizeof(__pyx_k_id), 0, 0, 1, 1},
22110  {&__pyx_n_s_import, __pyx_k_import, sizeof(__pyx_k_import), 0, 0, 1, 1},
22111  {&__pyx_n_s_init_cython, __pyx_k_init_cython, sizeof(__pyx_k_init_cython), 0, 0, 1, 1},
22112  {&__pyx_n_s_itemsize, __pyx_k_itemsize, sizeof(__pyx_k_itemsize), 0, 0, 1, 1},
22113  {&__pyx_kp_s_itemsize_0_for_cython_array, __pyx_k_itemsize_0_for_cython_array, sizeof(__pyx_k_itemsize_0_for_cython_array), 0, 0, 1, 0},
22114  {&__pyx_n_s_main, __pyx_k_main, sizeof(__pyx_k_main), 0, 0, 1, 1},
22115  {&__pyx_n_s_memview, __pyx_k_memview, sizeof(__pyx_k_memview), 0, 0, 1, 1},
22116  {&__pyx_n_s_mode, __pyx_k_mode, sizeof(__pyx_k_mode), 0, 0, 1, 1},
22117  {&__pyx_n_s_name, __pyx_k_name, sizeof(__pyx_k_name), 0, 0, 1, 1},
22118  {&__pyx_n_s_name_2, __pyx_k_name_2, sizeof(__pyx_k_name_2), 0, 0, 1, 1},
22119  {&__pyx_n_s_nd, __pyx_k_nd, sizeof(__pyx_k_nd), 0, 0, 1, 1},
22120  {&__pyx_kp_u_ndarray_is_not_C_contiguous, __pyx_k_ndarray_is_not_C_contiguous, sizeof(__pyx_k_ndarray_is_not_C_contiguous), 0, 1, 0, 0},
22121  {&__pyx_kp_u_ndarray_is_not_Fortran_contiguou, __pyx_k_ndarray_is_not_Fortran_contiguou, sizeof(__pyx_k_ndarray_is_not_Fortran_contiguou), 0, 1, 0, 0},
22122  {&__pyx_n_s_ndim, __pyx_k_ndim, sizeof(__pyx_k_ndim), 0, 0, 1, 1},
22123  {&__pyx_n_s_new, __pyx_k_new, sizeof(__pyx_k_new), 0, 0, 1, 1},
22124  {&__pyx_kp_s_no_default___reduce___due_to_non, __pyx_k_no_default___reduce___due_to_non, sizeof(__pyx_k_no_default___reduce___due_to_non), 0, 0, 1, 0},
22125  {&__pyx_kp_s_numpy_core_multiarray_failed_to, __pyx_k_numpy_core_multiarray_failed_to, sizeof(__pyx_k_numpy_core_multiarray_failed_to), 0, 0, 1, 0},
22126  {&__pyx_kp_s_numpy_core_umath_failed_to_impor, __pyx_k_numpy_core_umath_failed_to_impor, sizeof(__pyx_k_numpy_core_umath_failed_to_impor), 0, 0, 1, 0},
22127  {&__pyx_n_s_obj, __pyx_k_obj, sizeof(__pyx_k_obj), 0, 0, 1, 1},
22128  {&__pyx_n_s_pack, __pyx_k_pack, sizeof(__pyx_k_pack), 0, 0, 1, 1},
22129  {&__pyx_n_s_pickle, __pyx_k_pickle, sizeof(__pyx_k_pickle), 0, 0, 1, 1},
22130  {&__pyx_n_s_proteus, __pyx_k_proteus, sizeof(__pyx_k_proteus), 0, 0, 1, 1},
22131  {&__pyx_kp_s_proteus_BoundaryConditions_py, __pyx_k_proteus_BoundaryConditions_py, sizeof(__pyx_k_proteus_BoundaryConditions_py), 0, 0, 1, 0},
22132  {&__pyx_n_s_pyx_PickleError, __pyx_k_pyx_PickleError, sizeof(__pyx_k_pyx_PickleError), 0, 0, 1, 1},
22133  {&__pyx_n_s_pyx_checksum, __pyx_k_pyx_checksum, sizeof(__pyx_k_pyx_checksum), 0, 0, 1, 1},
22134  {&__pyx_n_s_pyx_getbuffer, __pyx_k_pyx_getbuffer, sizeof(__pyx_k_pyx_getbuffer), 0, 0, 1, 1},
22135  {&__pyx_n_s_pyx_result, __pyx_k_pyx_result, sizeof(__pyx_k_pyx_result), 0, 0, 1, 1},
22136  {&__pyx_n_s_pyx_state, __pyx_k_pyx_state, sizeof(__pyx_k_pyx_state), 0, 0, 1, 1},
22137  {&__pyx_n_s_pyx_type, __pyx_k_pyx_type, sizeof(__pyx_k_pyx_type), 0, 0, 1, 1},
22138  {&__pyx_n_s_pyx_unpickle_BC_Base, __pyx_k_pyx_unpickle_BC_Base, sizeof(__pyx_k_pyx_unpickle_BC_Base), 0, 0, 1, 1},
22139  {&__pyx_n_s_pyx_unpickle_Enum, __pyx_k_pyx_unpickle_Enum, sizeof(__pyx_k_pyx_unpickle_Enum), 0, 0, 1, 1},
22140  {&__pyx_n_s_pyx_vtable, __pyx_k_pyx_vtable, sizeof(__pyx_k_pyx_vtable), 0, 0, 1, 1},
22141  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
22142  {&__pyx_n_s_reduce, __pyx_k_reduce, sizeof(__pyx_k_reduce), 0, 0, 1, 1},
22143  {&__pyx_n_s_reduce_cython, __pyx_k_reduce_cython, sizeof(__pyx_k_reduce_cython), 0, 0, 1, 1},
22144  {&__pyx_n_s_reduce_ex, __pyx_k_reduce_ex, sizeof(__pyx_k_reduce_ex), 0, 0, 1, 1},
22145  {&__pyx_n_s_resetBC, __pyx_k_resetBC, sizeof(__pyx_k_resetBC), 0, 0, 1, 1},
22146  {&__pyx_n_s_self, __pyx_k_self, sizeof(__pyx_k_self), 0, 0, 1, 1},
22147  {&__pyx_kp_s_self_uuOfXT_cannot_be_converted, __pyx_k_self_uuOfXT_cannot_be_converted, sizeof(__pyx_k_self_uuOfXT_cannot_be_converted), 0, 0, 1, 0},
22148  {&__pyx_n_s_setConstantBC, __pyx_k_setConstantBC, sizeof(__pyx_k_setConstantBC), 0, 0, 1, 1},
22149  {&__pyx_n_s_setConstantBC_locals_lambda, __pyx_k_setConstantBC_locals_lambda, sizeof(__pyx_k_setConstantBC_locals_lambda), 0, 0, 1, 1},
22150  {&__pyx_n_s_setLinearBC, __pyx_k_setLinearBC, sizeof(__pyx_k_setLinearBC), 0, 0, 1, 1},
22151  {&__pyx_n_s_setLinearBC_locals_lambda, __pyx_k_setLinearBC_locals_lambda, sizeof(__pyx_k_setLinearBC_locals_lambda), 0, 0, 1, 1},
22152  {&__pyx_n_s_setstate, __pyx_k_setstate, sizeof(__pyx_k_setstate), 0, 0, 1, 1},
22153  {&__pyx_n_s_setstate_cython, __pyx_k_setstate_cython, sizeof(__pyx_k_setstate_cython), 0, 0, 1, 1},
22154  {&__pyx_n_s_shape, __pyx_k_shape, sizeof(__pyx_k_shape), 0, 0, 1, 1},
22155  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
22156  {&__pyx_n_s_start, __pyx_k_start, sizeof(__pyx_k_start), 0, 0, 1, 1},
22157  {&__pyx_n_s_state, __pyx_k_state, sizeof(__pyx_k_state), 0, 0, 1, 1},
22158  {&__pyx_n_s_step, __pyx_k_step, sizeof(__pyx_k_step), 0, 0, 1, 1},
22159  {&__pyx_n_s_stop, __pyx_k_stop, sizeof(__pyx_k_stop), 0, 0, 1, 1},
22160  {&__pyx_kp_s_strided_and_direct, __pyx_k_strided_and_direct, sizeof(__pyx_k_strided_and_direct), 0, 0, 1, 0},
22161  {&__pyx_kp_s_strided_and_direct_or_indirect, __pyx_k_strided_and_direct_or_indirect, sizeof(__pyx_k_strided_and_direct_or_indirect), 0, 0, 1, 0},
22162  {&__pyx_kp_s_strided_and_indirect, __pyx_k_strided_and_indirect, sizeof(__pyx_k_strided_and_indirect), 0, 0, 1, 0},
22163  {&__pyx_kp_s_stringsource, __pyx_k_stringsource, sizeof(__pyx_k_stringsource), 0, 0, 1, 0},
22164  {&__pyx_n_s_struct, __pyx_k_struct, sizeof(__pyx_k_struct), 0, 0, 1, 1},
22165  {&__pyx_n_s_t, __pyx_k_t, sizeof(__pyx_k_t), 0, 0, 1, 1},
22166  {&__pyx_n_s_test, __pyx_k_test, sizeof(__pyx_k_test), 0, 0, 1, 1},
22167  {&__pyx_kp_s_unable_to_allocate_array_data, __pyx_k_unable_to_allocate_array_data, sizeof(__pyx_k_unable_to_allocate_array_data), 0, 0, 1, 0},
22168  {&__pyx_kp_s_unable_to_allocate_shape_and_str, __pyx_k_unable_to_allocate_shape_and_str, sizeof(__pyx_k_unable_to_allocate_shape_and_str), 0, 0, 1, 0},
22169  {&__pyx_kp_u_unknown_dtype_code_in_numpy_pxd, __pyx_k_unknown_dtype_code_in_numpy_pxd, sizeof(__pyx_k_unknown_dtype_code_in_numpy_pxd), 0, 1, 0, 0},
22170  {&__pyx_n_s_unpack, __pyx_k_unpack, sizeof(__pyx_k_unpack), 0, 0, 1, 1},
22171  {&__pyx_n_s_update, __pyx_k_update, sizeof(__pyx_k_update), 0, 0, 1, 1},
22172  {&__pyx_n_s_use_setstate, __pyx_k_use_setstate, sizeof(__pyx_k_use_setstate), 0, 0, 1, 1},
22173  {&__pyx_n_s_value, __pyx_k_value, sizeof(__pyx_k_value), 0, 0, 1, 1},
22174  {&__pyx_n_s_x, __pyx_k_x, sizeof(__pyx_k_x), 0, 0, 1, 1},
22175  {0, 0, 0, 0, 0, 0, 0}
22176 };
22177 static int __Pyx_InitCachedBuiltins(void) {
22178  __pyx_builtin_TypeError = __Pyx_GetBuiltinName(__pyx_n_s_TypeError); if (!__pyx_builtin_TypeError) __PYX_ERR(0, 2, __pyx_L1_error)
22179  __pyx_builtin_ValueError = __Pyx_GetBuiltinName(__pyx_n_s_ValueError); if (!__pyx_builtin_ValueError) __PYX_ERR(3, 229, __pyx_L1_error)
22180  __pyx_builtin_range = __Pyx_GetBuiltinName(__pyx_n_s_range); if (!__pyx_builtin_range) __PYX_ERR(3, 242, __pyx_L1_error)
22181  __pyx_builtin_RuntimeError = __Pyx_GetBuiltinName(__pyx_n_s_RuntimeError); if (!__pyx_builtin_RuntimeError) __PYX_ERR(3, 810, __pyx_L1_error)
22182  __pyx_builtin_ImportError = __Pyx_GetBuiltinName(__pyx_n_s_ImportError); if (!__pyx_builtin_ImportError) __PYX_ERR(3, 1000, __pyx_L1_error)
22183  __pyx_builtin_MemoryError = __Pyx_GetBuiltinName(__pyx_n_s_MemoryError); if (!__pyx_builtin_MemoryError) __PYX_ERR(0, 147, __pyx_L1_error)
22184  __pyx_builtin_enumerate = __Pyx_GetBuiltinName(__pyx_n_s_enumerate); if (!__pyx_builtin_enumerate) __PYX_ERR(0, 150, __pyx_L1_error)
22185  __pyx_builtin_Ellipsis = __Pyx_GetBuiltinName(__pyx_n_s_Ellipsis); if (!__pyx_builtin_Ellipsis) __PYX_ERR(0, 399, __pyx_L1_error)
22186  __pyx_builtin_id = __Pyx_GetBuiltinName(__pyx_n_s_id); if (!__pyx_builtin_id) __PYX_ERR(0, 608, __pyx_L1_error)
22187  __pyx_builtin_IndexError = __Pyx_GetBuiltinName(__pyx_n_s_IndexError); if (!__pyx_builtin_IndexError) __PYX_ERR(0, 827, __pyx_L1_error)
22188  return 0;
22189  __pyx_L1_error:;
22190  return -1;
22191 }
22192 
22193 static int __Pyx_InitCachedConstants(void) {
22194  __Pyx_RefNannyDeclarations
22195  __Pyx_RefNannySetupContext("__Pyx_InitCachedConstants", 0);
22196 
22197  /* "(tree fragment)":2
22198  * def __reduce_cython__(self):
22199  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22200  * def __setstate_cython__(self, __pyx_state):
22201  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22202  */
22203  __pyx_tuple_ = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple_)) __PYX_ERR(0, 2, __pyx_L1_error)
22204  __Pyx_GOTREF(__pyx_tuple_);
22205  __Pyx_GIVEREF(__pyx_tuple_);
22206 
22207  /* "(tree fragment)":4
22208  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22209  * def __setstate_cython__(self, __pyx_state):
22210  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling") # <<<<<<<<<<<<<<
22211  */
22212  __pyx_tuple__2 = PyTuple_Pack(1, __pyx_kp_s_self_uuOfXT_cannot_be_converted); if (unlikely(!__pyx_tuple__2)) __PYX_ERR(0, 4, __pyx_L1_error)
22213  __Pyx_GOTREF(__pyx_tuple__2);
22214  __Pyx_GIVEREF(__pyx_tuple__2);
22215 
22216  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":229
22217  * if ((flags & pybuf.PyBUF_C_CONTIGUOUS == pybuf.PyBUF_C_CONTIGUOUS)
22218  * and not PyArray_CHKFLAGS(self, NPY_C_CONTIGUOUS)):
22219  * raise ValueError(u"ndarray is not C contiguous") # <<<<<<<<<<<<<<
22220  *
22221  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22222  */
22223  __pyx_tuple__3 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_C_contiguous); if (unlikely(!__pyx_tuple__3)) __PYX_ERR(3, 229, __pyx_L1_error)
22224  __Pyx_GOTREF(__pyx_tuple__3);
22225  __Pyx_GIVEREF(__pyx_tuple__3);
22226 
22227  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":233
22228  * if ((flags & pybuf.PyBUF_F_CONTIGUOUS == pybuf.PyBUF_F_CONTIGUOUS)
22229  * and not PyArray_CHKFLAGS(self, NPY_F_CONTIGUOUS)):
22230  * raise ValueError(u"ndarray is not Fortran contiguous") # <<<<<<<<<<<<<<
22231  *
22232  * info.buf = PyArray_DATA(self)
22233  */
22234  __pyx_tuple__4 = PyTuple_Pack(1, __pyx_kp_u_ndarray_is_not_Fortran_contiguou); if (unlikely(!__pyx_tuple__4)) __PYX_ERR(3, 233, __pyx_L1_error)
22235  __Pyx_GOTREF(__pyx_tuple__4);
22236  __Pyx_GIVEREF(__pyx_tuple__4);
22237 
22238  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":263
22239  * if ((descr.byteorder == c'>' and little_endian) or
22240  * (descr.byteorder == c'<' and not little_endian)):
22241  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22242  * if t == NPY_BYTE: f = "b"
22243  * elif t == NPY_UBYTE: f = "B"
22244  */
22245  __pyx_tuple__5 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__5)) __PYX_ERR(3, 263, __pyx_L1_error)
22246  __Pyx_GOTREF(__pyx_tuple__5);
22247  __Pyx_GIVEREF(__pyx_tuple__5);
22248 
22249  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":810
22250  *
22251  * if (end - f) - <int>(new_offset - offset[0]) < 15:
22252  * raise RuntimeError(u"Format string allocated too short, see comment in numpy.pxd") # <<<<<<<<<<<<<<
22253  *
22254  * if ((child.byteorder == c'>' and little_endian) or
22255  */
22256  __pyx_tuple__6 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor); if (unlikely(!__pyx_tuple__6)) __PYX_ERR(3, 810, __pyx_L1_error)
22257  __Pyx_GOTREF(__pyx_tuple__6);
22258  __Pyx_GIVEREF(__pyx_tuple__6);
22259 
22260  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":814
22261  * if ((child.byteorder == c'>' and little_endian) or
22262  * (child.byteorder == c'<' and not little_endian)):
22263  * raise ValueError(u"Non-native byte order not supported") # <<<<<<<<<<<<<<
22264  * # One could encode it in the format string and have Cython
22265  * # complain instead, BUT: < and > in format strings also imply
22266  */
22267  __pyx_tuple__7 = PyTuple_Pack(1, __pyx_kp_u_Non_native_byte_order_not_suppor); if (unlikely(!__pyx_tuple__7)) __PYX_ERR(3, 814, __pyx_L1_error)
22268  __Pyx_GOTREF(__pyx_tuple__7);
22269  __Pyx_GIVEREF(__pyx_tuple__7);
22270 
22271  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":834
22272  * t = child.type_num
22273  * if end - f < 5:
22274  * raise RuntimeError(u"Format string allocated too short.") # <<<<<<<<<<<<<<
22275  *
22276  * # Until ticket #99 is fixed, use integers to avoid warnings
22277  */
22278  __pyx_tuple__8 = PyTuple_Pack(1, __pyx_kp_u_Format_string_allocated_too_shor_2); if (unlikely(!__pyx_tuple__8)) __PYX_ERR(3, 834, __pyx_L1_error)
22279  __Pyx_GOTREF(__pyx_tuple__8);
22280  __Pyx_GIVEREF(__pyx_tuple__8);
22281 
22282  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1000
22283  * _import_array()
22284  * except Exception:
22285  * raise ImportError("numpy.core.multiarray failed to import") # <<<<<<<<<<<<<<
22286  *
22287  * cdef inline int import_umath() except -1:
22288  */
22289  __pyx_tuple__9 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_multiarray_failed_to); if (unlikely(!__pyx_tuple__9)) __PYX_ERR(3, 1000, __pyx_L1_error)
22290  __Pyx_GOTREF(__pyx_tuple__9);
22291  __Pyx_GIVEREF(__pyx_tuple__9);
22292 
22293  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1006
22294  * _import_umath()
22295  * except Exception:
22296  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22297  *
22298  * cdef inline int import_ufunc() except -1:
22299  */
22300  __pyx_tuple__10 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__10)) __PYX_ERR(3, 1006, __pyx_L1_error)
22301  __Pyx_GOTREF(__pyx_tuple__10);
22302  __Pyx_GIVEREF(__pyx_tuple__10);
22303 
22304  /* "linux2/lib/python2.7/site-packages/Cython/Includes/numpy/__init__.pxd":1012
22305  * _import_umath()
22306  * except Exception:
22307  * raise ImportError("numpy.core.umath failed to import") # <<<<<<<<<<<<<<
22308  */
22309  __pyx_tuple__11 = PyTuple_Pack(1, __pyx_kp_s_numpy_core_umath_failed_to_impor); if (unlikely(!__pyx_tuple__11)) __PYX_ERR(3, 1012, __pyx_L1_error)
22310  __Pyx_GOTREF(__pyx_tuple__11);
22311  __Pyx_GIVEREF(__pyx_tuple__11);
22312 
22313  /* "View.MemoryView":132
22314  *
22315  * if not self.ndim:
22316  * raise ValueError("Empty shape tuple for cython.array") # <<<<<<<<<<<<<<
22317  *
22318  * if itemsize <= 0:
22319  */
22320  __pyx_tuple__12 = PyTuple_Pack(1, __pyx_kp_s_Empty_shape_tuple_for_cython_arr); if (unlikely(!__pyx_tuple__12)) __PYX_ERR(0, 132, __pyx_L1_error)
22321  __Pyx_GOTREF(__pyx_tuple__12);
22322  __Pyx_GIVEREF(__pyx_tuple__12);
22323 
22324  /* "View.MemoryView":135
22325  *
22326  * if itemsize <= 0:
22327  * raise ValueError("itemsize <= 0 for cython.array") # <<<<<<<<<<<<<<
22328  *
22329  * if not isinstance(format, bytes):
22330  */
22331  __pyx_tuple__13 = PyTuple_Pack(1, __pyx_kp_s_itemsize_0_for_cython_array); if (unlikely(!__pyx_tuple__13)) __PYX_ERR(0, 135, __pyx_L1_error)
22332  __Pyx_GOTREF(__pyx_tuple__13);
22333  __Pyx_GIVEREF(__pyx_tuple__13);
22334 
22335  /* "View.MemoryView":138
22336  *
22337  * if not isinstance(format, bytes):
22338  * format = format.encode('ASCII') # <<<<<<<<<<<<<<
22339  * self._format = format # keep a reference to the byte string
22340  * self.format = self._format
22341  */
22342  __pyx_tuple__14 = PyTuple_Pack(1, __pyx_n_s_ASCII); if (unlikely(!__pyx_tuple__14)) __PYX_ERR(0, 138, __pyx_L1_error)
22343  __Pyx_GOTREF(__pyx_tuple__14);
22344  __Pyx_GIVEREF(__pyx_tuple__14);
22345 
22346  /* "View.MemoryView":147
22347  *
22348  * if not self._shape:
22349  * raise MemoryError("unable to allocate shape and strides.") # <<<<<<<<<<<<<<
22350  *
22351  *
22352  */
22353  __pyx_tuple__15 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_shape_and_str); if (unlikely(!__pyx_tuple__15)) __PYX_ERR(0, 147, __pyx_L1_error)
22354  __Pyx_GOTREF(__pyx_tuple__15);
22355  __Pyx_GIVEREF(__pyx_tuple__15);
22356 
22357  /* "View.MemoryView":175
22358  * self.data = <char *>malloc(self.len)
22359  * if not self.data:
22360  * raise MemoryError("unable to allocate array data.") # <<<<<<<<<<<<<<
22361  *
22362  * if self.dtype_is_object:
22363  */
22364  __pyx_tuple__16 = PyTuple_Pack(1, __pyx_kp_s_unable_to_allocate_array_data); if (unlikely(!__pyx_tuple__16)) __PYX_ERR(0, 175, __pyx_L1_error)
22365  __Pyx_GOTREF(__pyx_tuple__16);
22366  __Pyx_GIVEREF(__pyx_tuple__16);
22367 
22368  /* "View.MemoryView":191
22369  * bufmode = PyBUF_F_CONTIGUOUS | PyBUF_ANY_CONTIGUOUS
22370  * if not (flags & bufmode):
22371  * raise ValueError("Can only create a buffer that is contiguous in memory.") # <<<<<<<<<<<<<<
22372  * info.buf = self.data
22373  * info.len = self.len
22374  */
22375  __pyx_tuple__17 = PyTuple_Pack(1, __pyx_kp_s_Can_only_create_a_buffer_that_is); if (unlikely(!__pyx_tuple__17)) __PYX_ERR(0, 191, __pyx_L1_error)
22376  __Pyx_GOTREF(__pyx_tuple__17);
22377  __Pyx_GIVEREF(__pyx_tuple__17);
22378 
22379  /* "(tree fragment)":2
22380  * def __reduce_cython__(self):
22381  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22382  * def __setstate_cython__(self, __pyx_state):
22383  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22384  */
22385  __pyx_tuple__18 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__18)) __PYX_ERR(0, 2, __pyx_L1_error)
22386  __Pyx_GOTREF(__pyx_tuple__18);
22387  __Pyx_GIVEREF(__pyx_tuple__18);
22388 
22389  /* "(tree fragment)":4
22390  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22391  * def __setstate_cython__(self, __pyx_state):
22392  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22393  */
22394  __pyx_tuple__19 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__19)) __PYX_ERR(0, 4, __pyx_L1_error)
22395  __Pyx_GOTREF(__pyx_tuple__19);
22396  __Pyx_GIVEREF(__pyx_tuple__19);
22397 
22398  /* "View.MemoryView":413
22399  * def __setitem__(memoryview self, object index, object value):
22400  * if self.view.readonly:
22401  * raise TypeError("Cannot assign to read-only memoryview") # <<<<<<<<<<<<<<
22402  *
22403  * have_slices, index = _unellipsify(index, self.view.ndim)
22404  */
22405  __pyx_tuple__20 = PyTuple_Pack(1, __pyx_kp_s_Cannot_assign_to_read_only_memor); if (unlikely(!__pyx_tuple__20)) __PYX_ERR(0, 413, __pyx_L1_error)
22406  __Pyx_GOTREF(__pyx_tuple__20);
22407  __Pyx_GIVEREF(__pyx_tuple__20);
22408 
22409  /* "View.MemoryView":490
22410  * result = struct.unpack(self.view.format, bytesitem)
22411  * except struct.error:
22412  * raise ValueError("Unable to convert item to object") # <<<<<<<<<<<<<<
22413  * else:
22414  * if len(self.view.format) == 1:
22415  */
22416  __pyx_tuple__21 = PyTuple_Pack(1, __pyx_kp_s_Unable_to_convert_item_to_object); if (unlikely(!__pyx_tuple__21)) __PYX_ERR(0, 490, __pyx_L1_error)
22417  __Pyx_GOTREF(__pyx_tuple__21);
22418  __Pyx_GIVEREF(__pyx_tuple__21);
22419 
22420  /* "View.MemoryView":515
22421  * def __getbuffer__(self, Py_buffer *info, int flags):
22422  * if flags & PyBUF_WRITABLE and self.view.readonly:
22423  * raise ValueError("Cannot create writable memory view from read-only memoryview") # <<<<<<<<<<<<<<
22424  *
22425  * if flags & PyBUF_STRIDES:
22426  */
22427  __pyx_tuple__22 = PyTuple_Pack(1, __pyx_kp_s_Cannot_create_writable_memory_vi); if (unlikely(!__pyx_tuple__22)) __PYX_ERR(0, 515, __pyx_L1_error)
22428  __Pyx_GOTREF(__pyx_tuple__22);
22429  __Pyx_GIVEREF(__pyx_tuple__22);
22430 
22431  /* "View.MemoryView":565
22432  * if self.view.strides == NULL:
22433  *
22434  * raise ValueError("Buffer view does not expose strides") # <<<<<<<<<<<<<<
22435  *
22436  * return tuple([stride for stride in self.view.strides[:self.view.ndim]])
22437  */
22438  __pyx_tuple__23 = PyTuple_Pack(1, __pyx_kp_s_Buffer_view_does_not_expose_stri); if (unlikely(!__pyx_tuple__23)) __PYX_ERR(0, 565, __pyx_L1_error)
22439  __Pyx_GOTREF(__pyx_tuple__23);
22440  __Pyx_GIVEREF(__pyx_tuple__23);
22441 
22442  /* "View.MemoryView":572
22443  * def suboffsets(self):
22444  * if self.view.suboffsets == NULL:
22445  * return (-1,) * self.view.ndim # <<<<<<<<<<<<<<
22446  *
22447  * return tuple([suboffset for suboffset in self.view.suboffsets[:self.view.ndim]])
22448  */
22449  __pyx_tuple__24 = PyTuple_New(1); if (unlikely(!__pyx_tuple__24)) __PYX_ERR(0, 572, __pyx_L1_error)
22450  __Pyx_GOTREF(__pyx_tuple__24);
22451  __Pyx_INCREF(__pyx_int_neg_1);
22452  __Pyx_GIVEREF(__pyx_int_neg_1);
22453  PyTuple_SET_ITEM(__pyx_tuple__24, 0, __pyx_int_neg_1);
22454  __Pyx_GIVEREF(__pyx_tuple__24);
22455 
22456  /* "(tree fragment)":2
22457  * def __reduce_cython__(self):
22458  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22459  * def __setstate_cython__(self, __pyx_state):
22460  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22461  */
22462  __pyx_tuple__25 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__25)) __PYX_ERR(0, 2, __pyx_L1_error)
22463  __Pyx_GOTREF(__pyx_tuple__25);
22464  __Pyx_GIVEREF(__pyx_tuple__25);
22465 
22466  /* "(tree fragment)":4
22467  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22468  * def __setstate_cython__(self, __pyx_state):
22469  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22470  */
22471  __pyx_tuple__26 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__26)) __PYX_ERR(0, 4, __pyx_L1_error)
22472  __Pyx_GOTREF(__pyx_tuple__26);
22473  __Pyx_GIVEREF(__pyx_tuple__26);
22474 
22475  /* "View.MemoryView":677
22476  * if item is Ellipsis:
22477  * if not seen_ellipsis:
22478  * result.extend([slice(None)] * (ndim - len(tup) + 1)) # <<<<<<<<<<<<<<
22479  * seen_ellipsis = True
22480  * else:
22481  */
22482  __pyx_slice__27 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__27)) __PYX_ERR(0, 677, __pyx_L1_error)
22483  __Pyx_GOTREF(__pyx_slice__27);
22484  __Pyx_GIVEREF(__pyx_slice__27);
22485 
22486  /* "View.MemoryView":680
22487  * seen_ellipsis = True
22488  * else:
22489  * result.append(slice(None)) # <<<<<<<<<<<<<<
22490  * have_slices = True
22491  * else:
22492  */
22493  __pyx_slice__28 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__28)) __PYX_ERR(0, 680, __pyx_L1_error)
22494  __Pyx_GOTREF(__pyx_slice__28);
22495  __Pyx_GIVEREF(__pyx_slice__28);
22496 
22497  /* "View.MemoryView":691
22498  * nslices = ndim - len(result)
22499  * if nslices:
22500  * result.extend([slice(None)] * nslices) # <<<<<<<<<<<<<<
22501  *
22502  * return have_slices or nslices, tuple(result)
22503  */
22504  __pyx_slice__29 = PySlice_New(Py_None, Py_None, Py_None); if (unlikely(!__pyx_slice__29)) __PYX_ERR(0, 691, __pyx_L1_error)
22505  __Pyx_GOTREF(__pyx_slice__29);
22506  __Pyx_GIVEREF(__pyx_slice__29);
22507 
22508  /* "View.MemoryView":698
22509  * for suboffset in suboffsets[:ndim]:
22510  * if suboffset >= 0:
22511  * raise ValueError("Indirect dimensions not supported") # <<<<<<<<<<<<<<
22512  *
22513  *
22514  */
22515  __pyx_tuple__30 = PyTuple_Pack(1, __pyx_kp_s_Indirect_dimensions_not_supporte); if (unlikely(!__pyx_tuple__30)) __PYX_ERR(0, 698, __pyx_L1_error)
22516  __Pyx_GOTREF(__pyx_tuple__30);
22517  __Pyx_GIVEREF(__pyx_tuple__30);
22518 
22519  /* "(tree fragment)":2
22520  * def __reduce_cython__(self):
22521  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22522  * def __setstate_cython__(self, __pyx_state):
22523  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22524  */
22525  __pyx_tuple__31 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__31)) __PYX_ERR(0, 2, __pyx_L1_error)
22526  __Pyx_GOTREF(__pyx_tuple__31);
22527  __Pyx_GIVEREF(__pyx_tuple__31);
22528 
22529  /* "(tree fragment)":4
22530  * raise TypeError("no default __reduce__ due to non-trivial __cinit__")
22531  * def __setstate_cython__(self, __pyx_state):
22532  * raise TypeError("no default __reduce__ due to non-trivial __cinit__") # <<<<<<<<<<<<<<
22533  */
22534  __pyx_tuple__32 = PyTuple_Pack(1, __pyx_kp_s_no_default___reduce___due_to_non); if (unlikely(!__pyx_tuple__32)) __PYX_ERR(0, 4, __pyx_L1_error)
22535  __Pyx_GOTREF(__pyx_tuple__32);
22536  __Pyx_GIVEREF(__pyx_tuple__32);
22537 
22538  /* "BoundaryConditions.py":41
22539  * # setattr(BC_Base, name, default_value)
22540  *
22541  * def getContext(self, context=None): # <<<<<<<<<<<<<<
22542  * """
22543  * Gets context from proteus.Context or
22544  */
22545  __pyx_tuple__33 = PyTuple_Pack(3, __pyx_n_s_self, __pyx_n_s_context, __pyx_n_s_Context); if (unlikely(!__pyx_tuple__33)) __PYX_ERR(1, 41, __pyx_L1_error)
22546  __Pyx_GOTREF(__pyx_tuple__33);
22547  __Pyx_GIVEREF(__pyx_tuple__33);
22548  __pyx_codeobj__34 = (PyObject*)__Pyx_PyCode_New(2, 0, 3, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__33, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_getContext, 41, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__34)) __PYX_ERR(1, 41, __pyx_L1_error)
22549 
22550  /* "(tree fragment)":1
22551  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22552  * cdef bint use_setstate
22553  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
22554  */
22555  __pyx_tuple__35 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_use_setstate, __pyx_n_s_state, __pyx_n_s_dict_2); if (unlikely(!__pyx_tuple__35)) __PYX_ERR(0, 1, __pyx_L1_error)
22556  __Pyx_GOTREF(__pyx_tuple__35);
22557  __Pyx_GIVEREF(__pyx_tuple__35);
22558  __pyx_codeobj__36 = (PyObject*)__Pyx_PyCode_New(1, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__35, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__36)) __PYX_ERR(0, 1, __pyx_L1_error)
22559 
22560  /* "(tree fragment)":14
22561  * else:
22562  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
22563  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22564  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
22565  */
22566  __pyx_tuple__37 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__37)) __PYX_ERR(0, 14, __pyx_L1_error)
22567  __Pyx_GOTREF(__pyx_tuple__37);
22568  __Pyx_GIVEREF(__pyx_tuple__37);
22569  __pyx_codeobj__38 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__37, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 14, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__38)) __PYX_ERR(0, 14, __pyx_L1_error)
22570 
22571  /* "BoundaryConditions.py":70
22572  * self.uOfXT = None
22573  *
22574  * def init_cython(self): # <<<<<<<<<<<<<<
22575  * return self.uOfXT
22576  *
22577  */
22578  __pyx_tuple__39 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__39)) __PYX_ERR(1, 70, __pyx_L1_error)
22579  __Pyx_GOTREF(__pyx_tuple__39);
22580  __Pyx_GIVEREF(__pyx_tuple__39);
22581  __pyx_codeobj__40 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__39, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_init_cython, 70, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__40)) __PYX_ERR(1, 70, __pyx_L1_error)
22582 
22583  /* "BoundaryConditions.py":73
22584  * return self.uOfXT
22585  *
22586  * def resetBC(self): # <<<<<<<<<<<<<<
22587  * self.uOfXT = None
22588  *
22589  */
22590  __pyx_tuple__41 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__41)) __PYX_ERR(1, 73, __pyx_L1_error)
22591  __Pyx_GOTREF(__pyx_tuple__41);
22592  __Pyx_GIVEREF(__pyx_tuple__41);
22593  __pyx_codeobj__42 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__41, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_resetBC, 73, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__42)) __PYX_ERR(1, 73, __pyx_L1_error)
22594 
22595  /* "BoundaryConditions.py":76
22596  * self.uOfXT = None
22597  *
22598  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
22599  * """
22600  * function returning constant BC
22601  */
22602  __pyx_tuple__43 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_value); if (unlikely(!__pyx_tuple__43)) __PYX_ERR(1, 76, __pyx_L1_error)
22603  __Pyx_GOTREF(__pyx_tuple__43);
22604  __Pyx_GIVEREF(__pyx_tuple__43);
22605  __pyx_codeobj__44 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__43, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setConstantBC, 76, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__44)) __PYX_ERR(1, 76, __pyx_L1_error)
22606 
22607  /* "BoundaryConditions.py":88
22608  *
22609  *
22610  * def setLinearBC(self, a0, a1, i): # <<<<<<<<<<<<<<
22611  * self.uOfXT = lambda x, t: a0+a1*x[i]
22612  */
22613  __pyx_tuple__45 = PyTuple_Pack(4, __pyx_n_s_self, __pyx_n_s_a0, __pyx_n_s_a1, __pyx_n_s_i); if (unlikely(!__pyx_tuple__45)) __PYX_ERR(1, 88, __pyx_L1_error)
22614  __Pyx_GOTREF(__pyx_tuple__45);
22615  __Pyx_GIVEREF(__pyx_tuple__45);
22616  __pyx_codeobj__46 = (PyObject*)__Pyx_PyCode_New(4, 0, 4, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__45, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_proteus_BoundaryConditions_py, __pyx_n_s_setLinearBC, 88, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__46)) __PYX_ERR(1, 88, __pyx_L1_error)
22617 
22618  /* "(tree fragment)":1
22619  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
22620  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22621  * def __setstate_cython__(self, __pyx_state):
22622  */
22623  __pyx_tuple__47 = PyTuple_Pack(1, __pyx_n_s_self); if (unlikely(!__pyx_tuple__47)) __PYX_ERR(0, 1, __pyx_L1_error)
22624  __Pyx_GOTREF(__pyx_tuple__47);
22625  __Pyx_GIVEREF(__pyx_tuple__47);
22626  __pyx_codeobj__48 = (PyObject*)__Pyx_PyCode_New(1, 0, 1, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__47, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_reduce_cython, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__48)) __PYX_ERR(0, 1, __pyx_L1_error)
22627 
22628  /* "(tree fragment)":3
22629  * def __reduce_cython__(self):
22630  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22631  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
22632  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
22633  */
22634  __pyx_tuple__49 = PyTuple_Pack(2, __pyx_n_s_self, __pyx_n_s_pyx_state); if (unlikely(!__pyx_tuple__49)) __PYX_ERR(0, 3, __pyx_L1_error)
22635  __Pyx_GOTREF(__pyx_tuple__49);
22636  __Pyx_GIVEREF(__pyx_tuple__49);
22637  __pyx_codeobj__50 = (PyObject*)__Pyx_PyCode_New(2, 0, 2, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__49, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_setstate_cython, 3, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__50)) __PYX_ERR(0, 3, __pyx_L1_error)
22638 
22639  /* "(tree fragment)":1
22640  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22641  * if __pyx_checksum != 0x96e6a1f:
22642  * from pickle import PickleError as __pyx_PickleError
22643  */
22644  __pyx_tuple__51 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__51)) __PYX_ERR(0, 1, __pyx_L1_error)
22645  __Pyx_GOTREF(__pyx_tuple__51);
22646  __Pyx_GIVEREF(__pyx_tuple__51);
22647  __pyx_codeobj__52 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__51, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_BC_Base, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__52)) __PYX_ERR(0, 1, __pyx_L1_error)
22648 
22649  /* "View.MemoryView":285
22650  * return self.name
22651  *
22652  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
22653  * cdef strided = Enum("<strided and direct>") # default
22654  * cdef indirect = Enum("<strided and indirect>")
22655  */
22656  __pyx_tuple__53 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct_or_indirect); if (unlikely(!__pyx_tuple__53)) __PYX_ERR(0, 285, __pyx_L1_error)
22657  __Pyx_GOTREF(__pyx_tuple__53);
22658  __Pyx_GIVEREF(__pyx_tuple__53);
22659 
22660  /* "View.MemoryView":286
22661  *
22662  * cdef generic = Enum("<strided and direct or indirect>")
22663  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
22664  * cdef indirect = Enum("<strided and indirect>")
22665  *
22666  */
22667  __pyx_tuple__54 = PyTuple_Pack(1, __pyx_kp_s_strided_and_direct); if (unlikely(!__pyx_tuple__54)) __PYX_ERR(0, 286, __pyx_L1_error)
22668  __Pyx_GOTREF(__pyx_tuple__54);
22669  __Pyx_GIVEREF(__pyx_tuple__54);
22670 
22671  /* "View.MemoryView":287
22672  * cdef generic = Enum("<strided and direct or indirect>")
22673  * cdef strided = Enum("<strided and direct>") # default
22674  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
22675  *
22676  *
22677  */
22678  __pyx_tuple__55 = PyTuple_Pack(1, __pyx_kp_s_strided_and_indirect); if (unlikely(!__pyx_tuple__55)) __PYX_ERR(0, 287, __pyx_L1_error)
22679  __Pyx_GOTREF(__pyx_tuple__55);
22680  __Pyx_GIVEREF(__pyx_tuple__55);
22681 
22682  /* "View.MemoryView":290
22683  *
22684  *
22685  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
22686  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
22687  *
22688  */
22689  __pyx_tuple__56 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_direct); if (unlikely(!__pyx_tuple__56)) __PYX_ERR(0, 290, __pyx_L1_error)
22690  __Pyx_GOTREF(__pyx_tuple__56);
22691  __Pyx_GIVEREF(__pyx_tuple__56);
22692 
22693  /* "View.MemoryView":291
22694  *
22695  * cdef contiguous = Enum("<contiguous and direct>")
22696  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
22697  *
22698  *
22699  */
22700  __pyx_tuple__57 = PyTuple_Pack(1, __pyx_kp_s_contiguous_and_indirect); if (unlikely(!__pyx_tuple__57)) __PYX_ERR(0, 291, __pyx_L1_error)
22701  __Pyx_GOTREF(__pyx_tuple__57);
22702  __Pyx_GIVEREF(__pyx_tuple__57);
22703 
22704  /* "(tree fragment)":1
22705  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
22706  * if __pyx_checksum != 0xb068931:
22707  * from pickle import PickleError as __pyx_PickleError
22708  */
22709  __pyx_tuple__58 = PyTuple_Pack(5, __pyx_n_s_pyx_type, __pyx_n_s_pyx_checksum, __pyx_n_s_pyx_state, __pyx_n_s_pyx_PickleError, __pyx_n_s_pyx_result); if (unlikely(!__pyx_tuple__58)) __PYX_ERR(0, 1, __pyx_L1_error)
22710  __Pyx_GOTREF(__pyx_tuple__58);
22711  __Pyx_GIVEREF(__pyx_tuple__58);
22712  __pyx_codeobj__59 = (PyObject*)__Pyx_PyCode_New(3, 0, 5, 0, CO_OPTIMIZED|CO_NEWLOCALS, __pyx_empty_bytes, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_tuple__58, __pyx_empty_tuple, __pyx_empty_tuple, __pyx_kp_s_stringsource, __pyx_n_s_pyx_unpickle_Enum, 1, __pyx_empty_bytes); if (unlikely(!__pyx_codeobj__59)) __PYX_ERR(0, 1, __pyx_L1_error)
22713  __Pyx_RefNannyFinishContext();
22714  return 0;
22715  __pyx_L1_error:;
22716  __Pyx_RefNannyFinishContext();
22717  return -1;
22718 }
22719 
22720 static int __Pyx_InitGlobals(void) {
22721  if (__Pyx_InitStrings(__pyx_string_tab) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
22722  __pyx_int_0 = PyInt_FromLong(0); if (unlikely(!__pyx_int_0)) __PYX_ERR(1, 1, __pyx_L1_error)
22723  __pyx_int_1 = PyInt_FromLong(1); if (unlikely(!__pyx_int_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22724  __pyx_int_158231071 = PyInt_FromLong(158231071L); if (unlikely(!__pyx_int_158231071)) __PYX_ERR(1, 1, __pyx_L1_error)
22725  __pyx_int_184977713 = PyInt_FromLong(184977713L); if (unlikely(!__pyx_int_184977713)) __PYX_ERR(1, 1, __pyx_L1_error)
22726  __pyx_int_neg_1 = PyInt_FromLong(-1); if (unlikely(!__pyx_int_neg_1)) __PYX_ERR(1, 1, __pyx_L1_error)
22727  return 0;
22728  __pyx_L1_error:;
22729  return -1;
22730 }
22731 
22732 static int __Pyx_modinit_global_init_code(void); /*proto*/
22733 static int __Pyx_modinit_variable_export_code(void); /*proto*/
22734 static int __Pyx_modinit_function_export_code(void); /*proto*/
22735 static int __Pyx_modinit_type_init_code(void); /*proto*/
22736 static int __Pyx_modinit_type_import_code(void); /*proto*/
22737 static int __Pyx_modinit_variable_import_code(void); /*proto*/
22738 static int __Pyx_modinit_function_import_code(void); /*proto*/
22739 
22740 static int __Pyx_modinit_global_init_code(void) {
22741  __Pyx_RefNannyDeclarations
22742  __Pyx_RefNannySetupContext("__Pyx_modinit_global_init_code", 0);
22743  /*--- Global init code ---*/
22744  generic = Py_None; Py_INCREF(Py_None);
22745  strided = Py_None; Py_INCREF(Py_None);
22746  indirect = Py_None; Py_INCREF(Py_None);
22747  contiguous = Py_None; Py_INCREF(Py_None);
22748  indirect_contiguous = Py_None; Py_INCREF(Py_None);
22749  __Pyx_RefNannyFinishContext();
22750  return 0;
22751 }
22752 
22753 static int __Pyx_modinit_variable_export_code(void) {
22754  __Pyx_RefNannyDeclarations
22755  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_export_code", 0);
22756  /*--- Variable export code ---*/
22757  __Pyx_RefNannyFinishContext();
22758  return 0;
22759 }
22760 
22761 static int __Pyx_modinit_function_export_code(void) {
22762  __Pyx_RefNannyDeclarations
22763  __Pyx_RefNannySetupContext("__Pyx_modinit_function_export_code", 0);
22764  /*--- Function export code ---*/
22765  __Pyx_RefNannyFinishContext();
22766  return 0;
22767 }
22768 
22769 static int __Pyx_modinit_type_init_code(void) {
22770  __Pyx_RefNannyDeclarations
22771  __Pyx_RefNannySetupContext("__Pyx_modinit_type_init_code", 0);
22772  /*--- Type init code ---*/
22773  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
22774  __pyx_type_18BoundaryConditions_BC_Base.tp_print = 0;
22775  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BC_Base.tp_dictoffset && __pyx_type_18BoundaryConditions_BC_Base.tp_getattro == PyObject_GenericGetAttr)) {
22776  __pyx_type_18BoundaryConditions_BC_Base.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22777  }
22778  if (PyObject_SetAttrString(__pyx_m, "BC_Base", (PyObject *)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
22779  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BC_Base) < 0) __PYX_ERR(1, 9, __pyx_L1_error)
22780  __pyx_ptype_18BoundaryConditions_BC_Base = &__pyx_type_18BoundaryConditions_BC_Base;
22781  __pyx_vtabptr_18BoundaryConditions_BoundaryCondition = &__pyx_vtable_18BoundaryConditions_BoundaryCondition;
22782  __pyx_vtable_18BoundaryConditions_BoundaryCondition.resetBC = (void (*)(struct __pyx_obj_18BoundaryConditions_BoundaryCondition *, int __pyx_skip_dispatch))__pyx_f_18BoundaryConditions_17BoundaryCondition_resetBC;
22783  if (PyType_Ready(&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
22784  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_print = 0;
22785  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dictoffset && __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro == PyObject_GenericGetAttr)) {
22786  __pyx_type_18BoundaryConditions_BoundaryCondition.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22787  }
22788  if (__Pyx_SetVtable(__pyx_type_18BoundaryConditions_BoundaryCondition.tp_dict, __pyx_vtabptr_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
22789  if (PyObject_SetAttrString(__pyx_m, "BoundaryCondition", (PyObject *)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
22790  if (__Pyx_setup_reduce((PyObject*)&__pyx_type_18BoundaryConditions_BoundaryCondition) < 0) __PYX_ERR(1, 57, __pyx_L1_error)
22791  __pyx_ptype_18BoundaryConditions_BoundaryCondition = &__pyx_type_18BoundaryConditions_BoundaryCondition;
22792  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC) < 0) __PYX_ERR(1, 76, __pyx_L1_error)
22793  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_print = 0;
22794  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro == PyObject_GenericGetAttr)) {
22795  __pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
22796  }
22797  __pyx_ptype_18BoundaryConditions___pyx_scope_struct__setConstantBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct__setConstantBC;
22798  if (PyType_Ready(&__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC) < 0) __PYX_ERR(1, 88, __pyx_L1_error)
22799  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_print = 0;
22800  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_dictoffset && __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro == PyObject_GenericGetAttr)) {
22801  __pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC.tp_getattro = __Pyx_PyObject_GenericGetAttrNoDict;
22802  }
22803  __pyx_ptype_18BoundaryConditions___pyx_scope_struct_1_setLinearBC = &__pyx_type_18BoundaryConditions___pyx_scope_struct_1_setLinearBC;
22804  __pyx_vtabptr_array = &__pyx_vtable_array;
22805  __pyx_vtable_array.get_memview = (PyObject *(*)(struct __pyx_array_obj *))__pyx_array_get_memview;
22806  if (PyType_Ready(&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
22807  __pyx_type___pyx_array.tp_print = 0;
22808  if (__Pyx_SetVtable(__pyx_type___pyx_array.tp_dict, __pyx_vtabptr_array) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
22809  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_array) < 0) __PYX_ERR(0, 104, __pyx_L1_error)
22810  __pyx_array_type = &__pyx_type___pyx_array;
22811  if (PyType_Ready(&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
22812  __pyx_type___pyx_MemviewEnum.tp_print = 0;
22813  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_MemviewEnum.tp_dictoffset && __pyx_type___pyx_MemviewEnum.tp_getattro == PyObject_GenericGetAttr)) {
22814  __pyx_type___pyx_MemviewEnum.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22815  }
22816  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_MemviewEnum) < 0) __PYX_ERR(0, 278, __pyx_L1_error)
22817  __pyx_MemviewEnum_type = &__pyx_type___pyx_MemviewEnum;
22818  __pyx_vtabptr_memoryview = &__pyx_vtable_memoryview;
22819  __pyx_vtable_memoryview.get_item_pointer = (char *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_get_item_pointer;
22820  __pyx_vtable_memoryview.is_slice = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_is_slice;
22821  __pyx_vtable_memoryview.setitem_slice_assignment = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_slice_assignment;
22822  __pyx_vtable_memoryview.setitem_slice_assign_scalar = (PyObject *(*)(struct __pyx_memoryview_obj *, struct __pyx_memoryview_obj *, PyObject *))__pyx_memoryview_setitem_slice_assign_scalar;
22823  __pyx_vtable_memoryview.setitem_indexed = (PyObject *(*)(struct __pyx_memoryview_obj *, PyObject *, PyObject *))__pyx_memoryview_setitem_indexed;
22824  __pyx_vtable_memoryview.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryview_convert_item_to_object;
22825  __pyx_vtable_memoryview.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryview_assign_item_from_object;
22826  if (PyType_Ready(&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
22827  __pyx_type___pyx_memoryview.tp_print = 0;
22828  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryview.tp_dictoffset && __pyx_type___pyx_memoryview.tp_getattro == PyObject_GenericGetAttr)) {
22829  __pyx_type___pyx_memoryview.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22830  }
22831  if (__Pyx_SetVtable(__pyx_type___pyx_memoryview.tp_dict, __pyx_vtabptr_memoryview) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
22832  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryview) < 0) __PYX_ERR(0, 329, __pyx_L1_error)
22833  __pyx_memoryview_type = &__pyx_type___pyx_memoryview;
22834  __pyx_vtabptr__memoryviewslice = &__pyx_vtable__memoryviewslice;
22835  __pyx_vtable__memoryviewslice.__pyx_base = *__pyx_vtabptr_memoryview;
22836  __pyx_vtable__memoryviewslice.__pyx_base.convert_item_to_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *))__pyx_memoryviewslice_convert_item_to_object;
22837  __pyx_vtable__memoryviewslice.__pyx_base.assign_item_from_object = (PyObject *(*)(struct __pyx_memoryview_obj *, char *, PyObject *))__pyx_memoryviewslice_assign_item_from_object;
22838  __pyx_type___pyx_memoryviewslice.tp_base = __pyx_memoryview_type;
22839  if (PyType_Ready(&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
22840  __pyx_type___pyx_memoryviewslice.tp_print = 0;
22841  if ((CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP) && likely(!__pyx_type___pyx_memoryviewslice.tp_dictoffset && __pyx_type___pyx_memoryviewslice.tp_getattro == PyObject_GenericGetAttr)) {
22842  __pyx_type___pyx_memoryviewslice.tp_getattro = __Pyx_PyObject_GenericGetAttr;
22843  }
22844  if (__Pyx_SetVtable(__pyx_type___pyx_memoryviewslice.tp_dict, __pyx_vtabptr__memoryviewslice) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
22845  if (__Pyx_setup_reduce((PyObject*)&__pyx_type___pyx_memoryviewslice) < 0) __PYX_ERR(0, 960, __pyx_L1_error)
22846  __pyx_memoryviewslice_type = &__pyx_type___pyx_memoryviewslice;
22847  __Pyx_RefNannyFinishContext();
22848  return 0;
22849  __pyx_L1_error:;
22850  __Pyx_RefNannyFinishContext();
22851  return -1;
22852 }
22853 
22854 static int __Pyx_modinit_type_import_code(void) {
22855  __Pyx_RefNannyDeclarations
22856  __Pyx_RefNannySetupContext("__Pyx_modinit_type_import_code", 0);
22857  /*--- Type import code ---*/
22858  __pyx_ptype_7cpython_4type_type = __Pyx_ImportType(__Pyx_BUILTIN_MODULE_NAME, "type",
22859  #if defined(PYPY_VERSION_NUM) && PYPY_VERSION_NUM < 0x050B0000
22860  sizeof(PyTypeObject),
22861  #else
22862  sizeof(PyHeapTypeObject),
22863  #endif
22864  0); if (unlikely(!__pyx_ptype_7cpython_4type_type)) __PYX_ERR(4, 9, __pyx_L1_error)
22865  __pyx_ptype_5numpy_dtype = __Pyx_ImportType("numpy", "dtype", sizeof(PyArray_Descr), 0); if (unlikely(!__pyx_ptype_5numpy_dtype)) __PYX_ERR(3, 164, __pyx_L1_error)
22866  __pyx_ptype_5numpy_flatiter = __Pyx_ImportType("numpy", "flatiter", sizeof(PyArrayIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_flatiter)) __PYX_ERR(3, 186, __pyx_L1_error)
22867  __pyx_ptype_5numpy_broadcast = __Pyx_ImportType("numpy", "broadcast", sizeof(PyArrayMultiIterObject), 0); if (unlikely(!__pyx_ptype_5numpy_broadcast)) __PYX_ERR(3, 190, __pyx_L1_error)
22868  __pyx_ptype_5numpy_ndarray = __Pyx_ImportType("numpy", "ndarray", sizeof(PyArrayObject), 0); if (unlikely(!__pyx_ptype_5numpy_ndarray)) __PYX_ERR(3, 199, __pyx_L1_error)
22869  __pyx_ptype_5numpy_ufunc = __Pyx_ImportType("numpy", "ufunc", sizeof(PyUFuncObject), 0); if (unlikely(!__pyx_ptype_5numpy_ufunc)) __PYX_ERR(3, 872, __pyx_L1_error)
22870  __Pyx_RefNannyFinishContext();
22871  return 0;
22872  __pyx_L1_error:;
22873  __Pyx_RefNannyFinishContext();
22874  return -1;
22875 }
22876 
22877 static int __Pyx_modinit_variable_import_code(void) {
22878  __Pyx_RefNannyDeclarations
22879  __Pyx_RefNannySetupContext("__Pyx_modinit_variable_import_code", 0);
22880  /*--- Variable import code ---*/
22881  __Pyx_RefNannyFinishContext();
22882  return 0;
22883 }
22884 
22885 static int __Pyx_modinit_function_import_code(void) {
22886  __Pyx_RefNannyDeclarations
22887  __Pyx_RefNannySetupContext("__Pyx_modinit_function_import_code", 0);
22888  /*--- Function import code ---*/
22889  __Pyx_RefNannyFinishContext();
22890  return 0;
22891 }
22892 
22893 
22894 #if PY_MAJOR_VERSION < 3
22895 #ifdef CYTHON_NO_PYINIT_EXPORT
22896 #define __Pyx_PyMODINIT_FUNC void
22897 #else
22898 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22899 #endif
22900 #else
22901 #ifdef CYTHON_NO_PYINIT_EXPORT
22902 #define __Pyx_PyMODINIT_FUNC PyObject *
22903 #else
22904 #define __Pyx_PyMODINIT_FUNC PyMODINIT_FUNC
22905 #endif
22906 #endif
22907 #ifndef CYTHON_SMALL_CODE
22908 #if defined(__clang__)
22909  #define CYTHON_SMALL_CODE
22910 #elif defined(__GNUC__) && (!(defined(__cplusplus)) || (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 4)))
22911  #define CYTHON_SMALL_CODE __attribute__((cold))
22912 #else
22913  #define CYTHON_SMALL_CODE
22914 #endif
22915 #endif
22916 
22917 
22918 #if PY_MAJOR_VERSION < 3
22919 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
22920 __Pyx_PyMODINIT_FUNC initBoundaryConditions(void)
22921 #else
22922 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void) CYTHON_SMALL_CODE; /*proto*/
22923 __Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)
22924 #if CYTHON_PEP489_MULTI_PHASE_INIT
22925 {
22926  return PyModuleDef_Init(&__pyx_moduledef);
22927 }
22928 static int __Pyx_copy_spec_to_module(PyObject *spec, PyObject *moddict, const char* from_name, const char* to_name) {
22929  PyObject *value = PyObject_GetAttrString(spec, from_name);
22930  int result = 0;
22931  if (likely(value)) {
22932  result = PyDict_SetItemString(moddict, to_name, value);
22933  Py_DECREF(value);
22934  } else if (PyErr_ExceptionMatches(PyExc_AttributeError)) {
22935  PyErr_Clear();
22936  } else {
22937  result = -1;
22938  }
22939  return result;
22940 }
22941 static PyObject* __pyx_pymod_create(PyObject *spec, CYTHON_UNUSED PyModuleDef *def) {
22942  PyObject *module = NULL, *moddict, *modname;
22943  if (__pyx_m)
22944  return __Pyx_NewRef(__pyx_m);
22945  modname = PyObject_GetAttrString(spec, "name");
22946  if (unlikely(!modname)) goto bad;
22947  module = PyModule_NewObject(modname);
22948  Py_DECREF(modname);
22949  if (unlikely(!module)) goto bad;
22950  moddict = PyModule_GetDict(module);
22951  if (unlikely(!moddict)) goto bad;
22952  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "loader", "__loader__") < 0)) goto bad;
22953  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "origin", "__file__") < 0)) goto bad;
22954  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "parent", "__package__") < 0)) goto bad;
22955  if (unlikely(__Pyx_copy_spec_to_module(spec, moddict, "submodule_search_locations", "__path__") < 0)) goto bad;
22956  return module;
22957 bad:
22958  Py_XDECREF(module);
22959  return NULL;
22960 }
22961 
22962 
22963 static int __pyx_pymod_exec_BoundaryConditions(PyObject *__pyx_pyinit_module)
22964 #endif
22965 #endif
22966 {
22967  PyObject *__pyx_t_1 = NULL;
22968  static PyThread_type_lock __pyx_t_2[8];
22969  __Pyx_RefNannyDeclarations
22970  #if CYTHON_PEP489_MULTI_PHASE_INIT
22971  if (__pyx_m && __pyx_m == __pyx_pyinit_module) return 0;
22972  #elif PY_MAJOR_VERSION >= 3
22973  if (__pyx_m) return __Pyx_NewRef(__pyx_m);
22974  #endif
22975  #if CYTHON_REFNANNY
22976 __Pyx_RefNanny = __Pyx_RefNannyImportAPI("refnanny");
22977 if (!__Pyx_RefNanny) {
22978  PyErr_Clear();
22979  __Pyx_RefNanny = __Pyx_RefNannyImportAPI("Cython.Runtime.refnanny");
22980  if (!__Pyx_RefNanny)
22981  Py_FatalError("failed to import 'refnanny' module");
22982 }
22983 #endif
22984  __Pyx_RefNannySetupContext("__Pyx_PyMODINIT_FUNC PyInit_BoundaryConditions(void)", 0);
22985  if (__Pyx_check_binary_version() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22986  __pyx_empty_tuple = PyTuple_New(0); if (unlikely(!__pyx_empty_tuple)) __PYX_ERR(1, 1, __pyx_L1_error)
22987  __pyx_empty_bytes = PyBytes_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_bytes)) __PYX_ERR(1, 1, __pyx_L1_error)
22988  __pyx_empty_unicode = PyUnicode_FromStringAndSize("", 0); if (unlikely(!__pyx_empty_unicode)) __PYX_ERR(1, 1, __pyx_L1_error)
22989  #ifdef __Pyx_CyFunction_USED
22990  if (__pyx_CyFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22991  #endif
22992  #ifdef __Pyx_FusedFunction_USED
22993  if (__pyx_FusedFunction_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22994  #endif
22995  #ifdef __Pyx_Coroutine_USED
22996  if (__pyx_Coroutine_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
22997  #endif
22998  #ifdef __Pyx_Generator_USED
22999  if (__pyx_Generator_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23000  #endif
23001  #ifdef __Pyx_AsyncGen_USED
23002  if (__pyx_AsyncGen_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23003  #endif
23004  #ifdef __Pyx_StopAsyncIteration_USED
23005  if (__pyx_StopAsyncIteration_init() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23006  #endif
23007  /*--- Library function declarations ---*/
23008  /*--- Threads initialization code ---*/
23009  #if defined(__PYX_FORCE_INIT_THREADS) && __PYX_FORCE_INIT_THREADS
23010  #ifdef WITH_THREAD /* Python build with threading support? */
23011  PyEval_InitThreads();
23012  #endif
23013  #endif
23014  /*--- Module creation code ---*/
23015  #if CYTHON_PEP489_MULTI_PHASE_INIT
23016  __pyx_m = __pyx_pyinit_module;
23017  Py_INCREF(__pyx_m);
23018  #else
23019  #if PY_MAJOR_VERSION < 3
23020  __pyx_m = Py_InitModule4("BoundaryConditions", __pyx_methods, 0, 0, PYTHON_API_VERSION); Py_XINCREF(__pyx_m);
23021  #else
23022  __pyx_m = PyModule_Create(&__pyx_moduledef);
23023  #endif
23024  if (unlikely(!__pyx_m)) __PYX_ERR(1, 1, __pyx_L1_error)
23025  #endif
23026  __pyx_d = PyModule_GetDict(__pyx_m); if (unlikely(!__pyx_d)) __PYX_ERR(1, 1, __pyx_L1_error)
23027  Py_INCREF(__pyx_d);
23028  __pyx_b = PyImport_AddModule(__Pyx_BUILTIN_MODULE_NAME); if (unlikely(!__pyx_b)) __PYX_ERR(1, 1, __pyx_L1_error)
23029  __pyx_cython_runtime = PyImport_AddModule((char *) "cython_runtime"); if (unlikely(!__pyx_cython_runtime)) __PYX_ERR(1, 1, __pyx_L1_error)
23030  #if CYTHON_COMPILING_IN_PYPY
23031  Py_INCREF(__pyx_b);
23032  #endif
23033  if (PyObject_SetAttrString(__pyx_m, "__builtins__", __pyx_b) < 0) __PYX_ERR(1, 1, __pyx_L1_error);
23034  /*--- Initialize various global constants etc. ---*/
23035  if (__Pyx_InitGlobals() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23036  #if PY_MAJOR_VERSION < 3 && (__PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT)
23037  if (__Pyx_init_sys_getdefaultencoding_params() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23038  #endif
23039  if (__pyx_module_is_main_BoundaryConditions) {
23040  if (PyObject_SetAttrString(__pyx_m, "__name__", __pyx_n_s_main) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23041  }
23042  #if PY_MAJOR_VERSION >= 3
23043  {
23044  PyObject *modules = PyImport_GetModuleDict(); if (unlikely(!modules)) __PYX_ERR(1, 1, __pyx_L1_error)
23045  if (!PyDict_GetItemString(modules, "BoundaryConditions")) {
23046  if (unlikely(PyDict_SetItemString(modules, "BoundaryConditions", __pyx_m) < 0)) __PYX_ERR(1, 1, __pyx_L1_error)
23047  }
23048  }
23049  #endif
23050  /*--- Builtin init code ---*/
23051  if (__Pyx_InitCachedBuiltins() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23052  /*--- Constants init code ---*/
23053  if (__Pyx_InitCachedConstants() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23054  /*--- Global type/function init code ---*/
23055  (void)__Pyx_modinit_global_init_code();
23056  (void)__Pyx_modinit_variable_export_code();
23057  (void)__Pyx_modinit_function_export_code();
23058  if (unlikely(__Pyx_modinit_type_init_code() != 0)) goto __pyx_L1_error;
23059  if (unlikely(__Pyx_modinit_type_import_code() != 0)) goto __pyx_L1_error;
23060  (void)__Pyx_modinit_variable_import_code();
23061  (void)__Pyx_modinit_function_import_code();
23062  /*--- Execution code ---*/
23063  #if defined(__Pyx_Generator_USED) || defined(__Pyx_Coroutine_USED)
23064  if (__Pyx_patch_abc() < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23065  #endif
23066 
23067  /* "BoundaryConditions.py":41
23068  * # setattr(BC_Base, name, default_value)
23069  *
23070  * def getContext(self, context=None): # <<<<<<<<<<<<<<
23071  * """
23072  * Gets context from proteus.Context or
23073  */
23074  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_3getContext, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base_getContext, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__34)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 41, __pyx_L1_error)
23075  __Pyx_GOTREF(__pyx_t_1);
23076  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BC_Base->tp_dict, __pyx_n_s_getContext, __pyx_t_1) < 0) __PYX_ERR(1, 41, __pyx_L1_error)
23077  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23078  PyType_Modified(__pyx_ptype_18BoundaryConditions_BC_Base);
23079 
23080  /* "(tree fragment)":1
23081  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23082  * cdef bint use_setstate
23083  * state = (self.BC_type, self.Shape, self._b_or, self.ct, self.name, self.nd)
23084  */
23085  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_5__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___reduce_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__36)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23086  __Pyx_GOTREF(__pyx_t_1);
23087  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23088  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23089 
23090  /* "(tree fragment)":14
23091  * else:
23092  * return __pyx_unpickle_BC_Base, (type(self), 0x96e6a1f, state)
23093  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23094  * __pyx_unpickle_BC_Base__set_state(self, __pyx_state)
23095  */
23096  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_7BC_Base_7__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BC_Base___setstate_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__38)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 14, __pyx_L1_error)
23097  __Pyx_GOTREF(__pyx_t_1);
23098  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(0, 14, __pyx_L1_error)
23099  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23100 
23101  /* "BoundaryConditions.py":70
23102  * self.uOfXT = None
23103  *
23104  * def init_cython(self): # <<<<<<<<<<<<<<
23105  * return self.uOfXT
23106  *
23107  */
23108  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_3init_cython, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_init_cython, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__40)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 70, __pyx_L1_error)
23109  __Pyx_GOTREF(__pyx_t_1);
23110  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_init_cython, __pyx_t_1) < 0) __PYX_ERR(1, 70, __pyx_L1_error)
23111  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23112  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23113 
23114  /* "BoundaryConditions.py":73
23115  * return self.uOfXT
23116  *
23117  * def resetBC(self): # <<<<<<<<<<<<<<
23118  * self.uOfXT = None
23119  *
23120  */
23121  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_5resetBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_resetBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__42)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 73, __pyx_L1_error)
23122  __Pyx_GOTREF(__pyx_t_1);
23123  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_resetBC, __pyx_t_1) < 0) __PYX_ERR(1, 73, __pyx_L1_error)
23124  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23125  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23126 
23127  /* "BoundaryConditions.py":76
23128  * self.uOfXT = None
23129  *
23130  * def setConstantBC(self, value): # <<<<<<<<<<<<<<
23131  * """
23132  * function returning constant BC
23133  */
23134  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_7setConstantBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setConstantBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__44)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 76, __pyx_L1_error)
23135  __Pyx_GOTREF(__pyx_t_1);
23136  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setConstantBC, __pyx_t_1) < 0) __PYX_ERR(1, 76, __pyx_L1_error)
23137  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23138  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23139 
23140  /* "BoundaryConditions.py":88
23141  *
23142  *
23143  * def setLinearBC(self, a0, a1, i): # <<<<<<<<<<<<<<
23144  * self.uOfXT = lambda x, t: a0+a1*x[i]
23145  */
23146  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_9setLinearBC, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition_setLinearBC, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__46)); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 88, __pyx_L1_error)
23147  __Pyx_GOTREF(__pyx_t_1);
23148  if (PyDict_SetItem((PyObject *)__pyx_ptype_18BoundaryConditions_BoundaryCondition->tp_dict, __pyx_n_s_setLinearBC, __pyx_t_1) < 0) __PYX_ERR(1, 88, __pyx_L1_error)
23149  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23150  PyType_Modified(__pyx_ptype_18BoundaryConditions_BoundaryCondition);
23151 
23152  /* "(tree fragment)":1
23153  * def __reduce_cython__(self): # <<<<<<<<<<<<<<
23154  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23155  * def __setstate_cython__(self, __pyx_state):
23156  */
23157  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_11__reduce_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___reduce_cytho, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__48)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23158  __Pyx_GOTREF(__pyx_t_1);
23159  if (PyDict_SetItem(__pyx_d, __pyx_n_s_reduce_cython, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23160  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23161 
23162  /* "(tree fragment)":3
23163  * def __reduce_cython__(self):
23164  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23165  * def __setstate_cython__(self, __pyx_state): # <<<<<<<<<<<<<<
23166  * raise TypeError("self.uuOfXT cannot be converted to a Python object for pickling")
23167  */
23168  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_17BoundaryCondition_13__setstate_cython__, __Pyx_CYFUNCTION_CCLASS, __pyx_n_s_BoundaryCondition___setstate_cyt, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__50)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 3, __pyx_L1_error)
23169  __Pyx_GOTREF(__pyx_t_1);
23170  if (PyDict_SetItem(__pyx_d, __pyx_n_s_setstate_cython, __pyx_t_1) < 0) __PYX_ERR(0, 3, __pyx_L1_error)
23171  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23172 
23173  /* "(tree fragment)":1
23174  * def __pyx_unpickle_BC_Base(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23175  * if __pyx_checksum != 0x96e6a1f:
23176  * from pickle import PickleError as __pyx_PickleError
23177  */
23178  __pyx_t_1 = __Pyx_CyFunction_NewEx(&__pyx_mdef_18BoundaryConditions_1__pyx_unpickle_BC_Base, 0, __pyx_n_s_pyx_unpickle_BC_Base, NULL, __pyx_n_s_BoundaryConditions, __pyx_d, ((PyObject *)__pyx_codeobj__52)); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23179  __Pyx_GOTREF(__pyx_t_1);
23180  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_BC_Base, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23181  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23182 
23183  /* "BoundaryConditions.py":1
23184  * import cython # <<<<<<<<<<<<<<
23185  * """
23186  * Module for creating boundary conditions. Imported in SpatialTools.py
23187  */
23188  __pyx_t_1 = __Pyx_PyDict_NewPresized(0); if (unlikely(!__pyx_t_1)) __PYX_ERR(1, 1, __pyx_L1_error)
23189  __Pyx_GOTREF(__pyx_t_1);
23190  if (PyDict_SetItem(__pyx_d, __pyx_n_s_test, __pyx_t_1) < 0) __PYX_ERR(1, 1, __pyx_L1_error)
23191  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23192 
23193  /* "View.MemoryView":208
23194  * info.obj = self
23195  *
23196  * __pyx_getbuffer = capsule(<void *> &__pyx_array_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23197  *
23198  * def __dealloc__(array self):
23199  */
23200  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_array_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 208, __pyx_L1_error)
23201  __Pyx_GOTREF(__pyx_t_1);
23202  if (PyDict_SetItem((PyObject *)__pyx_array_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 208, __pyx_L1_error)
23203  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23204  PyType_Modified(__pyx_array_type);
23205 
23206  /* "View.MemoryView":285
23207  * return self.name
23208  *
23209  * cdef generic = Enum("<strided and direct or indirect>") # <<<<<<<<<<<<<<
23210  * cdef strided = Enum("<strided and direct>") # default
23211  * cdef indirect = Enum("<strided and indirect>")
23212  */
23213  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__53, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 285, __pyx_L1_error)
23214  __Pyx_GOTREF(__pyx_t_1);
23215  __Pyx_XGOTREF(generic);
23216  __Pyx_DECREF_SET(generic, __pyx_t_1);
23217  __Pyx_GIVEREF(__pyx_t_1);
23218  __pyx_t_1 = 0;
23219 
23220  /* "View.MemoryView":286
23221  *
23222  * cdef generic = Enum("<strided and direct or indirect>")
23223  * cdef strided = Enum("<strided and direct>") # default # <<<<<<<<<<<<<<
23224  * cdef indirect = Enum("<strided and indirect>")
23225  *
23226  */
23227  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__54, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 286, __pyx_L1_error)
23228  __Pyx_GOTREF(__pyx_t_1);
23229  __Pyx_XGOTREF(strided);
23230  __Pyx_DECREF_SET(strided, __pyx_t_1);
23231  __Pyx_GIVEREF(__pyx_t_1);
23232  __pyx_t_1 = 0;
23233 
23234  /* "View.MemoryView":287
23235  * cdef generic = Enum("<strided and direct or indirect>")
23236  * cdef strided = Enum("<strided and direct>") # default
23237  * cdef indirect = Enum("<strided and indirect>") # <<<<<<<<<<<<<<
23238  *
23239  *
23240  */
23241  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__55, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 287, __pyx_L1_error)
23242  __Pyx_GOTREF(__pyx_t_1);
23243  __Pyx_XGOTREF(indirect);
23244  __Pyx_DECREF_SET(indirect, __pyx_t_1);
23245  __Pyx_GIVEREF(__pyx_t_1);
23246  __pyx_t_1 = 0;
23247 
23248  /* "View.MemoryView":290
23249  *
23250  *
23251  * cdef contiguous = Enum("<contiguous and direct>") # <<<<<<<<<<<<<<
23252  * cdef indirect_contiguous = Enum("<contiguous and indirect>")
23253  *
23254  */
23255  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__56, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 290, __pyx_L1_error)
23256  __Pyx_GOTREF(__pyx_t_1);
23257  __Pyx_XGOTREF(contiguous);
23258  __Pyx_DECREF_SET(contiguous, __pyx_t_1);
23259  __Pyx_GIVEREF(__pyx_t_1);
23260  __pyx_t_1 = 0;
23261 
23262  /* "View.MemoryView":291
23263  *
23264  * cdef contiguous = Enum("<contiguous and direct>")
23265  * cdef indirect_contiguous = Enum("<contiguous and indirect>") # <<<<<<<<<<<<<<
23266  *
23267  *
23268  */
23269  __pyx_t_1 = __Pyx_PyObject_Call(((PyObject *)__pyx_MemviewEnum_type), __pyx_tuple__57, NULL); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 291, __pyx_L1_error)
23270  __Pyx_GOTREF(__pyx_t_1);
23271  __Pyx_XGOTREF(indirect_contiguous);
23272  __Pyx_DECREF_SET(indirect_contiguous, __pyx_t_1);
23273  __Pyx_GIVEREF(__pyx_t_1);
23274  __pyx_t_1 = 0;
23275 
23276  /* "View.MemoryView":315
23277  *
23278  * DEF THREAD_LOCKS_PREALLOCATED = 8
23279  * cdef int __pyx_memoryview_thread_locks_used = 0 # <<<<<<<<<<<<<<
23280  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [
23281  * PyThread_allocate_lock(),
23282  */
23283  __pyx_memoryview_thread_locks_used = 0;
23284 
23285  /* "View.MemoryView":316
23286  * DEF THREAD_LOCKS_PREALLOCATED = 8
23287  * cdef int __pyx_memoryview_thread_locks_used = 0
23288  * cdef PyThread_type_lock[THREAD_LOCKS_PREALLOCATED] __pyx_memoryview_thread_locks = [ # <<<<<<<<<<<<<<
23289  * PyThread_allocate_lock(),
23290  * PyThread_allocate_lock(),
23291  */
23292  __pyx_t_2[0] = PyThread_allocate_lock();
23293  __pyx_t_2[1] = PyThread_allocate_lock();
23294  __pyx_t_2[2] = PyThread_allocate_lock();
23295  __pyx_t_2[3] = PyThread_allocate_lock();
23296  __pyx_t_2[4] = PyThread_allocate_lock();
23297  __pyx_t_2[5] = PyThread_allocate_lock();
23298  __pyx_t_2[6] = PyThread_allocate_lock();
23299  __pyx_t_2[7] = PyThread_allocate_lock();
23300  memcpy(&(__pyx_memoryview_thread_locks[0]), __pyx_t_2, sizeof(__pyx_memoryview_thread_locks[0]) * (8));
23301 
23302  /* "View.MemoryView":544
23303  * info.obj = self
23304  *
23305  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23306  *
23307  *
23308  */
23309  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 544, __pyx_L1_error)
23310  __Pyx_GOTREF(__pyx_t_1);
23311  if (PyDict_SetItem((PyObject *)__pyx_memoryview_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 544, __pyx_L1_error)
23312  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23313  PyType_Modified(__pyx_memoryview_type);
23314 
23315  /* "View.MemoryView":990
23316  * return self.from_object
23317  *
23318  * __pyx_getbuffer = capsule(<void *> &__pyx_memoryview_getbuffer, "getbuffer(obj, view, flags)") # <<<<<<<<<<<<<<
23319  *
23320  *
23321  */
23322  __pyx_t_1 = __pyx_capsule_create(((void *)(&__pyx_memoryview_getbuffer)), ((char *)"getbuffer(obj, view, flags)")); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 990, __pyx_L1_error)
23323  __Pyx_GOTREF(__pyx_t_1);
23324  if (PyDict_SetItem((PyObject *)__pyx_memoryviewslice_type->tp_dict, __pyx_n_s_pyx_getbuffer, __pyx_t_1) < 0) __PYX_ERR(0, 990, __pyx_L1_error)
23325  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23326  PyType_Modified(__pyx_memoryviewslice_type);
23327 
23328  /* "(tree fragment)":1
23329  * def __pyx_unpickle_Enum(__pyx_type, long __pyx_checksum, __pyx_state): # <<<<<<<<<<<<<<
23330  * if __pyx_checksum != 0xb068931:
23331  * from pickle import PickleError as __pyx_PickleError
23332  */
23333  __pyx_t_1 = PyCFunction_NewEx(&__pyx_mdef_15View_dot_MemoryView_1__pyx_unpickle_Enum, NULL, __pyx_n_s_View_MemoryView); if (unlikely(!__pyx_t_1)) __PYX_ERR(0, 1, __pyx_L1_error)
23334  __Pyx_GOTREF(__pyx_t_1);
23335  if (PyDict_SetItem(__pyx_d, __pyx_n_s_pyx_unpickle_Enum, __pyx_t_1) < 0) __PYX_ERR(0, 1, __pyx_L1_error)
23336  __Pyx_DECREF(__pyx_t_1); __pyx_t_1 = 0;
23337 
23338  /* "(tree fragment)":9
23339  * __pyx_unpickle_Enum__set_state(<Enum> __pyx_result, __pyx_state)
23340  * return __pyx_result
23341  * cdef __pyx_unpickle_Enum__set_state(Enum __pyx_result, tuple __pyx_state): # <<<<<<<<<<<<<<
23342  * __pyx_result.name = __pyx_state[0]
23343  * if len(__pyx_state) > 1 and hasattr(__pyx_result, '__dict__'):
23344  */
23345 
23346  /*--- Wrapped vars code ---*/
23347 
23348  goto __pyx_L0;
23349  __pyx_L1_error:;
23350  __Pyx_XDECREF(__pyx_t_1);
23351  if (__pyx_m) {
23352  if (__pyx_d) {
23353  __Pyx_AddTraceback("init BoundaryConditions", 0, __pyx_lineno, __pyx_filename);
23354  }
23355  Py_DECREF(__pyx_m); __pyx_m = 0;
23356  } else if (!PyErr_Occurred()) {
23357  PyErr_SetString(PyExc_ImportError, "init BoundaryConditions");
23358  }
23359  __pyx_L0:;
23360  __Pyx_RefNannyFinishContext();
23361  #if CYTHON_PEP489_MULTI_PHASE_INIT
23362  return (__pyx_m != NULL) ? 0 : -1;
23363  #elif PY_MAJOR_VERSION >= 3
23364  return __pyx_m;
23365  #else
23366  return;
23367  #endif
23368 }
23369 
23370 /* --- Runtime support code --- */
23371 /* Refnanny */
23372 #if CYTHON_REFNANNY
23373 static __Pyx_RefNannyAPIStruct *__Pyx_RefNannyImportAPI(const char *modname) {
23374  PyObject *m = NULL, *p = NULL;
23375  void *r = NULL;
23376  m = PyImport_ImportModule((char *)modname);
23377  if (!m) goto end;
23378  p = PyObject_GetAttrString(m, (char *)"RefNannyAPI");
23379  if (!p) goto end;
23380  r = PyLong_AsVoidPtr(p);
23381 end:
23382  Py_XDECREF(p);
23383  Py_XDECREF(m);
23384  return (__Pyx_RefNannyAPIStruct *)r;
23385 }
23386 #endif
23387 
23388 /* PyObjectGetAttrStr */
23389 #if CYTHON_USE_TYPE_SLOTS
23390 static CYTHON_INLINE PyObject* __Pyx_PyObject_GetAttrStr(PyObject* obj, PyObject* attr_name) {
23391  PyTypeObject* tp = Py_TYPE(obj);
23392  if (likely(tp->tp_getattro))
23393  return tp->tp_getattro(obj, attr_name);
23394 #if PY_MAJOR_VERSION < 3
23395  if (likely(tp->tp_getattr))
23396  return tp->tp_getattr(obj, PyString_AS_STRING(attr_name));
23397 #endif
23398  return PyObject_GetAttr(obj, attr_name);
23399 }
23400 #endif
23401 
23402 /* GetBuiltinName */
23403 static PyObject *__Pyx_GetBuiltinName(PyObject *name) {
23404  PyObject* result = __Pyx_PyObject_GetAttrStr(__pyx_b, name);
23405  if (unlikely(!result)) {
23406  PyErr_Format(PyExc_NameError,
23407 #if PY_MAJOR_VERSION >= 3
23408  "name '%U' is not defined", name);
23409 #else
23410  "name '%.200s' is not defined", PyString_AS_STRING(name));
23411 #endif
23412  }
23413  return result;
23414 }
23415 
23416 /* RaiseDoubleKeywords */
23417 static void __Pyx_RaiseDoubleKeywordsError(
23418  const char* func_name,
23419  PyObject* kw_name)
23420 {
23421  PyErr_Format(PyExc_TypeError,
23422  #if PY_MAJOR_VERSION >= 3
23423  "%s() got multiple values for keyword argument '%U'", func_name, kw_name);
23424  #else
23425  "%s() got multiple values for keyword argument '%s'", func_name,
23426  PyString_AsString(kw_name));
23427  #endif
23428 }
23429 
23430 /* ParseKeywords */
23431 static int __Pyx_ParseOptionalKeywords(
23432  PyObject *kwds,
23433  PyObject **argnames[],
23434  PyObject *kwds2,
23435  PyObject *values[],
23436  Py_ssize_t num_pos_args,
23437  const char* function_name)
23438 {
23439  PyObject *key = 0, *value = 0;
23440  Py_ssize_t pos = 0;
23441  PyObject*** name;
23442  PyObject*** first_kw_arg = argnames + num_pos_args;
23443  while (PyDict_Next(kwds, &pos, &key, &value)) {
23444  name = first_kw_arg;
23445  while (*name && (**name != key)) name++;
23446  if (*name) {
23447  values[name-argnames] = value;
23448  continue;
23449  }
23450  name = first_kw_arg;
23451  #if PY_MAJOR_VERSION < 3
23452  if (likely(PyString_CheckExact(key)) || likely(PyString_Check(key))) {
23453  while (*name) {
23454  if ((CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**name) == PyString_GET_SIZE(key))
23455  && _PyString_Eq(**name, key)) {
23456  values[name-argnames] = value;
23457  break;
23458  }
23459  name++;
23460  }
23461  if (*name) continue;
23462  else {
23463  PyObject*** argname = argnames;
23464  while (argname != first_kw_arg) {
23465  if ((**argname == key) || (
23466  (CYTHON_COMPILING_IN_PYPY || PyString_GET_SIZE(**argname) == PyString_GET_SIZE(key))
23467  && _PyString_Eq(**argname, key))) {
23468  goto arg_passed_twice;
23469  }
23470  argname++;
23471  }
23472  }
23473  } else
23474  #endif
23475  if (likely(PyUnicode_Check(key))) {
23476  while (*name) {
23477  int cmp = (**name == key) ? 0 :
23478  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23479  (PyUnicode_GET_SIZE(**name) != PyUnicode_GET_SIZE(key)) ? 1 :
23480  #endif
23481  PyUnicode_Compare(**name, key);
23482  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23483  if (cmp == 0) {
23484  values[name-argnames] = value;
23485  break;
23486  }
23487  name++;
23488  }
23489  if (*name) continue;
23490  else {
23491  PyObject*** argname = argnames;
23492  while (argname != first_kw_arg) {
23493  int cmp = (**argname == key) ? 0 :
23494  #if !CYTHON_COMPILING_IN_PYPY && PY_MAJOR_VERSION >= 3
23495  (PyUnicode_GET_SIZE(**argname) != PyUnicode_GET_SIZE(key)) ? 1 :
23496  #endif
23497  PyUnicode_Compare(**argname, key);
23498  if (cmp < 0 && unlikely(PyErr_Occurred())) goto bad;
23499  if (cmp == 0) goto arg_passed_twice;
23500  argname++;
23501  }
23502  }
23503  } else
23504  goto invalid_keyword_type;
23505  if (kwds2) {
23506  if (unlikely(PyDict_SetItem(kwds2, key, value))) goto bad;
23507  } else {
23508  goto invalid_keyword;
23509  }
23510  }
23511  return 0;
23512 arg_passed_twice:
23513  __Pyx_RaiseDoubleKeywordsError(function_name, key);
23514  goto bad;
23515 invalid_keyword_type:
23516  PyErr_Format(PyExc_TypeError,
23517  "%.200s() keywords must be strings", function_name);
23518  goto bad;
23519 invalid_keyword:
23520  PyErr_Format(PyExc_TypeError,
23521  #if PY_MAJOR_VERSION < 3
23522  "%.200s() got an unexpected keyword argument '%.200s'",
23523  function_name, PyString_AsString(key));
23524  #else
23525  "%s() got an unexpected keyword argument '%U'",
23526  function_name, key);
23527  #endif
23528 bad:
23529  return -1;
23530 }
23531 
23532 /* RaiseArgTupleInvalid */
23533 static void __Pyx_RaiseArgtupleInvalid(
23534  const char* func_name,
23535  int exact,
23536  Py_ssize_t num_min,
23537  Py_ssize_t num_max,
23538  Py_ssize_t num_found)
23539 {
23540  Py_ssize_t num_expected;
23541  const char *more_or_less;
23542  if (num_found < num_min) {
23543  num_expected = num_min;
23544  more_or_less = "at least";
23545  } else {
23546  num_expected = num_max;
23547  more_or_less = "at most";
23548  }
23549  if (exact) {
23550  more_or_less = "exactly";
23551  }
23552  PyErr_Format(PyExc_TypeError,
23553  "%.200s() takes %.8s %" CYTHON_FORMAT_SSIZE_T "d positional argument%.1s (%" CYTHON_FORMAT_SSIZE_T "d given)",
23554  func_name, more_or_less, num_expected,
23555  (num_expected == 1) ? "" : "s", num_found);
23556 }
23557 
23558 /* GetItemInt */
23559 static PyObject *__Pyx_GetItemInt_Generic(PyObject *o, PyObject* j) {
23560  PyObject *r;
23561  if (!j) return NULL;
23562  r = PyObject_GetItem(o, j);
23563  Py_DECREF(j);
23564  return r;
23565 }
23566 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_List_Fast(PyObject *o, Py_ssize_t i,
23567  CYTHON_NCP_UNUSED int wraparound,
23568  CYTHON_NCP_UNUSED int boundscheck) {
23569 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23570  Py_ssize_t wrapped_i = i;
23571  if (wraparound & unlikely(i < 0)) {
23572  wrapped_i += PyList_GET_SIZE(o);
23573  }
23574  if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyList_GET_SIZE(o)))) {
23575  PyObject *r = PyList_GET_ITEM(o, wrapped_i);
23576  Py_INCREF(r);
23577  return r;
23578  }
23579  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23580 #else
23581  return PySequence_GetItem(o, i);
23582 #endif
23583 }
23584 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Tuple_Fast(PyObject *o, Py_ssize_t i,
23585  CYTHON_NCP_UNUSED int wraparound,
23586  CYTHON_NCP_UNUSED int boundscheck) {
23587 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
23588  Py_ssize_t wrapped_i = i;
23589  if (wraparound & unlikely(i < 0)) {
23590  wrapped_i += PyTuple_GET_SIZE(o);
23591  }
23592  if ((!boundscheck) || likely((0 <= wrapped_i) & (wrapped_i < PyTuple_GET_SIZE(o)))) {
23593  PyObject *r = PyTuple_GET_ITEM(o, wrapped_i);
23594  Py_INCREF(r);
23595  return r;
23596  }
23597  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23598 #else
23599  return PySequence_GetItem(o, i);
23600 #endif
23601 }
23602 static CYTHON_INLINE PyObject *__Pyx_GetItemInt_Fast(PyObject *o, Py_ssize_t i, int is_list,
23603  CYTHON_NCP_UNUSED int wraparound,
23604  CYTHON_NCP_UNUSED int boundscheck) {
23605 #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS && CYTHON_USE_TYPE_SLOTS
23606  if (is_list || PyList_CheckExact(o)) {
23607  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyList_GET_SIZE(o);
23608  if ((!boundscheck) || (likely((n >= 0) & (n < PyList_GET_SIZE(o))))) {
23609  PyObject *r = PyList_GET_ITEM(o, n);
23610  Py_INCREF(r);
23611  return r;
23612  }
23613  }
23614  else if (PyTuple_CheckExact(o)) {
23615  Py_ssize_t n = ((!wraparound) | likely(i >= 0)) ? i : i + PyTuple_GET_SIZE(o);
23616  if ((!boundscheck) || likely((n >= 0) & (n < PyTuple_GET_SIZE(o)))) {
23617  PyObject *r = PyTuple_GET_ITEM(o, n);
23618  Py_INCREF(r);
23619  return r;
23620  }
23621  } else {
23622  PySequenceMethods *m = Py_TYPE(o)->tp_as_sequence;
23623  if (likely(m && m->sq_item)) {
23624  if (wraparound && unlikely(i < 0) && likely(m->sq_length)) {
23625  Py_ssize_t l = m->sq_length(o);
23626  if (likely(l >= 0)) {
23627  i += l;
23628  } else {
23629  if (!PyErr_ExceptionMatches(PyExc_OverflowError))
23630  return NULL;
23631  PyErr_Clear();
23632  }
23633  }
23634  return m->sq_item(o, i);
23635  }
23636  }
23637 #else
23638  if (is_list || PySequence_Check(o)) {
23639  return PySequence_GetItem(o, i);
23640  }
23641 #endif
23642  return __Pyx_GetItemInt_Generic(o, PyInt_FromSsize_t(i));
23643 }
23644 
23645 /* ObjectGetItem */
23646 #if CYTHON_USE_TYPE_SLOTS
23647 static PyObject *__Pyx_PyObject_GetIndex(PyObject *obj, PyObject* index) {
23648  PyObject *runerr;
23649  Py_ssize_t key_value;
23650  PySequenceMethods *m = Py_TYPE(obj)->tp_as_sequence;
23651  if (unlikely(!(m && m->sq_item))) {
23652  PyErr_Format(PyExc_TypeError, "'%.200s' object is not subscriptable", Py_TYPE(obj)->tp_name);
23653  return NULL;
23654  }
23655  key_value = __Pyx_PyIndex_AsSsize_t(index);
23656  if (likely(key_value != -1 || !(runerr = PyErr_Occurred()))) {
23657  return __Pyx_GetItemInt_Fast(obj, key_value, 0, 1, 1);
23658  }
23659  if (PyErr_GivenExceptionMatches(runerr, PyExc_OverflowError)) {
23660  PyErr_Clear();
23661  PyErr_Format(PyExc_IndexError, "cannot fit '%.200s' into an index-sized integer", Py_TYPE(index)->tp_name);
23662  }
23663  return NULL;
23664 }
23665 static PyObject *__Pyx_PyObject_GetItem(PyObject *obj, PyObject* key) {
23666  PyMappingMethods *m = Py_TYPE(obj)->tp_as_mapping;
23667  if (likely(m && m->mp_subscript)) {
23668  return m->mp_subscript(obj, key);
23669  }
23670  return __Pyx_PyObject_GetIndex(obj, key);
23671 }
23672 #endif
23673 
23674 /* MemviewSliceInit */
23675 static int
23676 __Pyx_init_memviewslice(struct __pyx_memoryview_obj *memview,
23677  int ndim,
23678  __Pyx_memviewslice *memviewslice,
23679  int memview_is_new_reference)
23680 {
23681  __Pyx_RefNannyDeclarations
23682  int i, retval=-1;
23683  Py_buffer *buf = &memview->view;
23684  __Pyx_RefNannySetupContext("init_memviewslice", 0);
23685  if (!buf) {
23686  PyErr_SetString(PyExc_ValueError,
23687  "buf is NULL.");
23688  goto fail;
23689  } else if (memviewslice->memview || memviewslice->data) {
23690  PyErr_SetString(PyExc_ValueError,
23691  "memviewslice is already initialized!");
23692  goto fail;
23693  }
23694  if (buf->strides) {
23695  for (i = 0; i < ndim; i++) {
23696  memviewslice->strides[i] = buf->strides[i];
23697  }
23698  } else {
23699  Py_ssize_t stride = buf->itemsize;
23700  for (i = ndim - 1; i >= 0; i--) {
23701  memviewslice->strides[i] = stride;
23702  stride *= buf->shape[i];
23703  }
23704  }
23705  for (i = 0; i < ndim; i++) {
23706  memviewslice->shape[i] = buf->shape[i];
23707  if (buf->suboffsets) {
23708  memviewslice->suboffsets[i] = buf->suboffsets[i];
23709  } else {
23710  memviewslice->suboffsets[i] = -1;
23711  }
23712  }
23713  memviewslice->memview = memview;
23714  memviewslice->data = (char *)buf->buf;
23715  if (__pyx_add_acquisition_count(memview) == 0 && !memview_is_new_reference) {
23716  Py_INCREF(memview);
23717  }
23718  retval = 0;
23719  goto no_fail;
23720 fail:
23721  memviewslice->memview = 0;
23722  memviewslice->data = 0;
23723  retval = -1;
23724 no_fail:
23725  __Pyx_RefNannyFinishContext();
23726  return retval;
23727 }
23728 #ifndef Py_NO_RETURN
23729 #define Py_NO_RETURN
23730 #endif
23731 static void __pyx_fatalerror(const char *fmt, ...) Py_NO_RETURN {
23732  va_list vargs;
23733  char msg[200];
23734 #ifdef HAVE_STDARG_PROTOTYPES
23735  va_start(vargs, fmt);
23736 #else
23737  va_start(vargs);
23738 #endif
23739  vsnprintf(msg, 200, fmt, vargs);
23740  va_end(vargs);
23741  Py_FatalError(msg);
23742 }
23743 static CYTHON_INLINE int
23744 __pyx_add_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23745  PyThread_type_lock lock)
23746 {
23747  int result;
23748  PyThread_acquire_lock(lock, 1);
23749  result = (*acquisition_count)++;
23750  PyThread_release_lock(lock);
23751  return result;
23752 }
23753 static CYTHON_INLINE int
23754 __pyx_sub_acquisition_count_locked(__pyx_atomic_int *acquisition_count,
23755  PyThread_type_lock lock)
23756 {
23757  int result;
23758  PyThread_acquire_lock(lock, 1);
23759  result = (*acquisition_count)--;
23760  PyThread_release_lock(lock);
23761  return result;
23762 }
23763 static CYTHON_INLINE void
23764 __Pyx_INC_MEMVIEW(__Pyx_memviewslice *memslice, int have_gil, int lineno)
23765 {
23766  int first_time;
23767  struct __pyx_memoryview_obj *memview = memslice->memview;
23768  if (!memview || (PyObject *) memview == Py_None)
23769  return;
23770  if (__pyx_get_slice_count(memview) < 0)
23771  __pyx_fatalerror("Acquisition count is %d (line %d)",
23772  __pyx_get_slice_count(memview), lineno);
23773  first_time = __pyx_add_acquisition_count(memview) == 0;
23774  if (first_time) {
23775  if (have_gil) {
23776  Py_INCREF((PyObject *) memview);
23777  } else {
23778  PyGILState_STATE _gilstate = PyGILState_Ensure();
23779  Py_INCREF((PyObject *) memview);
23780  PyGILState_Release(_gilstate);
23781  }
23782  }
23783 }
23784 static CYTHON_INLINE void __Pyx_XDEC_MEMVIEW(__Pyx_memviewslice *memslice,
23785  int have_gil, int lineno) {
23786  int last_time;
23787  struct __pyx_memoryview_obj *memview = memslice->memview;
23788  if (!memview ) {
23789  return;
23790  } else if ((PyObject *) memview == Py_None) {
23791  memslice->memview = NULL;
23792  return;
23793  }
23794  if (__pyx_get_slice_count(memview) <= 0)
23795  __pyx_fatalerror("Acquisition count is %d (line %d)",
23796  __pyx_get_slice_count(memview), lineno);
23797  last_time = __pyx_sub_acquisition_count(memview) == 1;
23798  memslice->data = NULL;
23799  if (last_time) {
23800  if (have_gil) {
23801  Py_CLEAR(memslice->memview);
23802  } else {
23803  PyGILState_STATE _gilstate = PyGILState_Ensure();
23804  Py_CLEAR(memslice->memview);
23805  PyGILState_Release(_gilstate);
23806  }
23807  } else {
23808  memslice->memview = NULL;
23809  }
23810 }
23811 
23812 /* Import */
23813 static PyObject *__Pyx_Import(PyObject *name, PyObject *from_list, int level) {
23814  PyObject *empty_list = 0;
23815  PyObject *module = 0;
23816  PyObject *global_dict = 0;
23817  PyObject *empty_dict = 0;
23818  PyObject *list;
23819  #if PY_MAJOR_VERSION < 3
23820  PyObject *py_import;
23821  py_import = __Pyx_PyObject_GetAttrStr(__pyx_b, __pyx_n_s_import);
23822  if (!py_import)
23823  goto bad;
23824  #endif
23825  if (from_list)
23826  list = from_list;
23827  else {
23828  empty_list = PyList_New(0);
23829  if (!empty_list)
23830  goto bad;
23831  list = empty_list;
23832  }
23833  global_dict = PyModule_GetDict(__pyx_m);
23834  if (!global_dict)
23835  goto bad;
23836  empty_dict = PyDict_New();
23837  if (!empty_dict)
23838  goto bad;
23839  {
23840  #if PY_MAJOR_VERSION >= 3
23841  if (level == -1) {
23842  if (strchr(__Pyx_MODULE_NAME, '.')) {
23843  module = PyImport_ImportModuleLevelObject(
23844  name, global_dict, empty_dict, list, 1);
23845  if (!module) {
23846  if (!PyErr_ExceptionMatches(PyExc_ImportError))
23847  goto bad;
23848  PyErr_Clear();
23849  }
23850  }
23851  level = 0;
23852  }
23853  #endif
23854  if (!module) {
23855  #if PY_MAJOR_VERSION < 3
23856  PyObject *py_level = PyInt_FromLong(level);
23857  if (!py_level)
23858  goto bad;
23859  module = PyObject_CallFunctionObjArgs(py_import,
23860  name, global_dict, empty_dict, list, py_level, NULL);
23861  Py_DECREF(py_level);
23862  #else
23863  module = PyImport_ImportModuleLevelObject(
23864  name, global_dict, empty_dict, list, level);
23865  #endif
23866  }
23867  }
23868 bad:
23869  #if PY_MAJOR_VERSION < 3
23870  Py_XDECREF(py_import);
23871  #endif
23872  Py_XDECREF(empty_list);
23873  Py_XDECREF(empty_dict);
23874  return module;
23875 }
23876 
23877 /* ImportFrom */
23878 static PyObject* __Pyx_ImportFrom(PyObject* module, PyObject* name) {
23879  PyObject* value = __Pyx_PyObject_GetAttrStr(module, name);
23880  if (unlikely(!value) && PyErr_ExceptionMatches(PyExc_AttributeError)) {
23881  PyErr_Format(PyExc_ImportError,
23882  #if PY_MAJOR_VERSION < 3
23883  "cannot import name %.230s", PyString_AS_STRING(name));
23884  #else
23885  "cannot import name %S", name);
23886  #endif
23887  }
23888  return value;
23889 }
23890 
23891 /* PyCFunctionFastCall */
23892 #if CYTHON_FAST_PYCCALL
23893 static CYTHON_INLINE PyObject * __Pyx_PyCFunction_FastCall(PyObject *func_obj, PyObject **args, Py_ssize_t nargs) {
23894  PyCFunctionObject *func = (PyCFunctionObject*)func_obj;
23895  PyCFunction meth = PyCFunction_GET_FUNCTION(func);
23896  PyObject *self = PyCFunction_GET_SELF(func);
23897  int flags = PyCFunction_GET_FLAGS(func);
23898  assert(PyCFunction_Check(func));
23899  assert(METH_FASTCALL == (flags & ~(METH_CLASS | METH_STATIC | METH_COEXIST | METH_KEYWORDS)));
23900  assert(nargs >= 0);
23901  assert(nargs == 0 || args != NULL);
23902  /* _PyCFunction_FastCallDict() must not be called with an exception set,
23903  because it may clear it (directly or indirectly) and so the
23904  caller loses its exception */
23905  assert(!PyErr_Occurred());
23906  if ((PY_VERSION_HEX < 0x030700A0) || unlikely(flags & METH_KEYWORDS)) {
23907  return (*((__Pyx_PyCFunctionFastWithKeywords)meth)) (self, args, nargs, NULL);
23908  } else {
23909  return (*((__Pyx_PyCFunctionFast)meth)) (self, args, nargs);
23910  }
23911 }
23912 #endif
23913 
23914 /* PyFunctionFastCall */
23915 #if CYTHON_FAST_PYCALL
23916 #include "frameobject.h"
23917 static PyObject* __Pyx_PyFunction_FastCallNoKw(PyCodeObject *co, PyObject **args, Py_ssize_t na,
23918  PyObject *globals) {
23919  PyFrameObject *f;
23920  PyThreadState *tstate = __Pyx_PyThreadState_Current;
23921  PyObject **fastlocals;
23922  Py_ssize_t i;
23923  PyObject *result;
23924  assert(globals != NULL);
23925  /* XXX Perhaps we should create a specialized
23926  PyFrame_New() that doesn't take locals, but does
23927  take builtins without sanity checking them.
23928  */
23929  assert(tstate != NULL);
23930  f = PyFrame_New(tstate, co, globals, NULL);
23931  if (f == NULL) {
23932  return NULL;
23933  }
23934  fastlocals = f->f_localsplus;
23935  for (i = 0; i < na; i++) {
23936  Py_INCREF(*args);
23937  fastlocals[i] = *args++;
23938  }
23939  result = PyEval_EvalFrameEx(f,0);
23940  ++tstate->recursion_depth;
23941  Py_DECREF(f);
23942  --tstate->recursion_depth;
23943  return result;
23944 }
23945 #if 1 || PY_VERSION_HEX < 0x030600B1
23946 static PyObject *__Pyx_PyFunction_FastCallDict(PyObject *func, PyObject **args, int nargs, PyObject *kwargs) {
23947  PyCodeObject *co = (PyCodeObject *)PyFunction_GET_CODE(func);
23948  PyObject *globals = PyFunction_GET_GLOBALS(func);
23949  PyObject *argdefs = PyFunction_GET_DEFAULTS(func);
23950  PyObject *closure;
23951 #if PY_MAJOR_VERSION >= 3
23952  PyObject *kwdefs;
23953 #endif
23954  PyObject *kwtuple, **k;
23955  PyObject **d;
23956  Py_ssize_t nd;
23957  Py_ssize_t nk;
23958  PyObject *result;
23959  assert(kwargs == NULL || PyDict_Check(kwargs));
23960  nk = kwargs ? PyDict_Size(kwargs) : 0;
23961  if (Py_EnterRecursiveCall((char*)" while calling a Python object")) {
23962  return NULL;
23963  }
23964  if (
23965 #if PY_MAJOR_VERSION >= 3
23966  co->co_kwonlyargcount == 0 &&
23967 #endif
23968  likely(kwargs == NULL || nk == 0) &&
23969  co->co_flags == (CO_OPTIMIZED | CO_NEWLOCALS | CO_NOFREE)) {
23970  if (argdefs == NULL && co->co_argcount == nargs) {
23971  result = __Pyx_PyFunction_FastCallNoKw(co, args, nargs, globals);
23972  goto done;
23973  }
23974  else if (nargs == 0 && argdefs != NULL
23975  && co->co_argcount == Py_SIZE(argdefs)) {
23976  /* function called with no arguments, but all parameters have
23977  a default value: use default values as arguments .*/
23978  args = &PyTuple_GET_ITEM(argdefs, 0);
23979  result =__Pyx_PyFunction_FastCallNoKw(co, args, Py_SIZE(argdefs), globals);
23980  goto done;
23981  }
23982  }
23983  if (kwargs != NULL) {
23984  Py_ssize_t pos, i;
23985  kwtuple = PyTuple_New(2 * nk);
23986  if (kwtuple == NULL) {
23987  result = NULL;
23988  goto done;
23989  }
23990  k = &PyTuple_GET_ITEM(kwtuple, 0);
23991  pos = i = 0;
23992  while (PyDict_Next(kwargs, &pos, &k[i], &k[i+1])) {
23993  Py_INCREF(k[i]);
23994  Py_INCREF(k[i+1]);
23995  i += 2;
23996  }
23997  nk = i / 2;
23998  }
23999  else {
24000  kwtuple = NULL;
24001  k = NULL;
24002  }
24003  closure = PyFunction_GET_CLOSURE(func);
24004 #if PY_MAJOR_VERSION >= 3
24005  kwdefs = PyFunction_GET_KW_DEFAULTS(func);
24006 #endif
24007  if (argdefs != NULL) {
24008  d = &PyTuple_GET_ITEM(argdefs, 0);
24009  nd = Py_SIZE(argdefs);
24010  }
24011  else {
24012  d = NULL;
24013  nd = 0;
24014  }
24015 #if PY_MAJOR_VERSION >= 3
24016  result = PyEval_EvalCodeEx((PyObject*)co, globals, (PyObject *)NULL,
24017  args, nargs,
24018  k, (int)nk,
24019  d, (int)nd, kwdefs, closure);
24020 #else
24021  result = PyEval_EvalCodeEx(co, globals, (PyObject *)NULL,
24022  args, nargs,
24023  k, (int)nk,
24024  d, (int)nd, closure);
24025 #endif
24026  Py_XDECREF(kwtuple);
24027 done:
24028  Py_LeaveRecursiveCall();
24029  return result;
24030 }
24031 #endif
24032 #endif
24033 
24034 /* PyObjectCall */
24035 #if CYTHON_COMPILING_IN_CPYTHON
24036 static CYTHON_INLINE PyObject* __Pyx_PyObject_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24037  PyObject *result;
24038  ternaryfunc call = func->ob_type->tp_call;
24039  if (unlikely(!call))
24040  return PyObject_Call(func, arg, kw);
24041  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24042  return NULL;
24043  result = (*call)(func, arg, kw);
24044  Py_LeaveRecursiveCall();
24045  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24046  PyErr_SetString(
24047  PyExc_SystemError,
24048  "NULL result without error in PyObject_Call");
24049  }
24050  return result;
24051 }
24052 #endif
24053 
24054 /* PyObjectCallMethO */
24055 #if CYTHON_COMPILING_IN_CPYTHON
24056 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallMethO(PyObject *func, PyObject *arg) {
24057  PyObject *self, *result;
24058  PyCFunction cfunc;
24059  cfunc = PyCFunction_GET_FUNCTION(func);
24060  self = PyCFunction_GET_SELF(func);
24061  if (unlikely(Py_EnterRecursiveCall((char*)" while calling a Python object")))
24062  return NULL;
24063  result = cfunc(self, arg);
24064  Py_LeaveRecursiveCall();
24065  if (unlikely(!result) && unlikely(!PyErr_Occurred())) {
24066  PyErr_SetString(
24067  PyExc_SystemError,
24068  "NULL result without error in PyObject_Call");
24069  }
24070  return result;
24071 }
24072 #endif
24073 
24074 /* PyObjectCallOneArg */
24075 #if CYTHON_COMPILING_IN_CPYTHON
24076 static PyObject* __Pyx__PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24077  PyObject *result;
24078  PyObject *args = PyTuple_New(1);
24079  if (unlikely(!args)) return NULL;
24080  Py_INCREF(arg);
24081  PyTuple_SET_ITEM(args, 0, arg);
24082  result = __Pyx_PyObject_Call(func, args, NULL);
24083  Py_DECREF(args);
24084  return result;
24085 }
24086 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24087 #if CYTHON_FAST_PYCALL
24088  if (PyFunction_Check(func)) {
24089  return __Pyx_PyFunction_FastCall(func, &arg, 1);
24090  }
24091 #endif
24092  if (likely(PyCFunction_Check(func))) {
24093  if (likely(PyCFunction_GET_FLAGS(func) & METH_O)) {
24094  return __Pyx_PyObject_CallMethO(func, arg);
24095 #if CYTHON_FAST_PYCCALL
24096  } else if (PyCFunction_GET_FLAGS(func) & METH_FASTCALL) {
24097  return __Pyx_PyCFunction_FastCall(func, &arg, 1);
24098 #endif
24099  }
24100  }
24101  return __Pyx__PyObject_CallOneArg(func, arg);
24102 }
24103 #else
24104 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallOneArg(PyObject *func, PyObject *arg) {
24105  PyObject *result;
24106  PyObject *args = PyTuple_Pack(1, arg);
24107  if (unlikely(!args)) return NULL;
24108  result = __Pyx_PyObject_Call(func, args, NULL);
24109  Py_DECREF(args);
24110  return result;
24111 }
24112 #endif
24113 
24114 /* PyObjectCallNoArg */
24115 #if CYTHON_COMPILING_IN_CPYTHON
24116 static CYTHON_INLINE PyObject* __Pyx_PyObject_CallNoArg(PyObject *func) {
24117 #if CYTHON_FAST_PYCALL
24118  if (PyFunction_Check(func)) {
24119  return __Pyx_PyFunction_FastCall(func, NULL, 0);
24120  }
24121 #endif
24122 #ifdef __Pyx_CyFunction_USED
24123  if (likely(PyCFunction_Check(func) || __Pyx_TypeCheck(func, __pyx_CyFunctionType))) {
24124 #else
24125  if (likely(PyCFunction_Check(func))) {
24126 #endif
24127  if (likely(PyCFunction_GET_FLAGS(func) & METH_NOARGS)) {
24128  return __Pyx_PyObject_CallMethO(func, NULL);
24129  }
24130  }
24131  return __Pyx_PyObject_Call(func, __pyx_empty_tuple, NULL);
24132 }
24133 #endif
24134 
24135 /* PyErrExceptionMatches */
24136  #if CYTHON_FAST_THREAD_STATE
24137 static int __Pyx_PyErr_ExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
24138  Py_ssize_t i, n;
24139  n = PyTuple_GET_SIZE(tuple);
24140 #if PY_MAJOR_VERSION >= 3
24141  for (i=0; i<n; i++) {
24142  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
24143  }
24144 #endif
24145  for (i=0; i<n; i++) {
24146  if (__Pyx_PyErr_GivenExceptionMatches(exc_type, PyTuple_GET_ITEM(tuple, i))) return 1;
24147  }
24148  return 0;
24149 }
24150 static CYTHON_INLINE int __Pyx_PyErr_ExceptionMatchesInState(PyThreadState* tstate, PyObject* err) {
24151  PyObject *exc_type = tstate->curexc_type;
24152  if (exc_type == err) return 1;
24153  if (unlikely(!exc_type)) return 0;
24154  if (unlikely(PyTuple_Check(err)))
24155  return __Pyx_PyErr_ExceptionMatchesTuple(exc_type, err);
24156  return __Pyx_PyErr_GivenExceptionMatches(exc_type, err);
24157 }
24158 #endif
24159 
24160 /* PyErrFetchRestore */
24161  #if CYTHON_FAST_THREAD_STATE
24162 static CYTHON_INLINE void __Pyx_ErrRestoreInState(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
24163  PyObject *tmp_type, *tmp_value, *tmp_tb;
24164  tmp_type = tstate->curexc_type;
24165  tmp_value = tstate->curexc_value;
24166  tmp_tb = tstate->curexc_traceback;
24167  tstate->curexc_type = type;
24168  tstate->curexc_value = value;
24169  tstate->curexc_traceback = tb;
24170  Py_XDECREF(tmp_type);
24171  Py_XDECREF(tmp_value);
24172  Py_XDECREF(tmp_tb);
24173 }
24174 static CYTHON_INLINE void __Pyx_ErrFetchInState(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
24175  *type = tstate->curexc_type;
24176  *value = tstate->curexc_value;
24177  *tb = tstate->curexc_traceback;
24178  tstate->curexc_type = 0;
24179  tstate->curexc_value = 0;
24180  tstate->curexc_traceback = 0;
24181 }
24182 #endif
24183 
24184 /* GetAttr */
24185  static CYTHON_INLINE PyObject *__Pyx_GetAttr(PyObject *o, PyObject *n) {
24186 #if CYTHON_USE_TYPE_SLOTS
24187 #if PY_MAJOR_VERSION >= 3
24188  if (likely(PyUnicode_Check(n)))
24189 #else
24190  if (likely(PyString_Check(n)))
24191 #endif
24192  return __Pyx_PyObject_GetAttrStr(o, n);
24193 #endif
24194  return PyObject_GetAttr(o, n);
24195 }
24196 
24197 /* GetAttr3 */
24198  static PyObject *__Pyx_GetAttr3Default(PyObject *d) {
24199  __Pyx_PyThreadState_declare
24200  __Pyx_PyThreadState_assign
24201  if (unlikely(!__Pyx_PyErr_ExceptionMatches(PyExc_AttributeError)))
24202  return NULL;
24203  __Pyx_PyErr_Clear();
24204  Py_INCREF(d);
24205  return d;
24206 }
24207 static CYTHON_INLINE PyObject *__Pyx_GetAttr3(PyObject *o, PyObject *n, PyObject *d) {
24208  PyObject *r = __Pyx_GetAttr(o, n);
24209  return (likely(r)) ? r : __Pyx_GetAttr3Default(d);
24210 }
24211 
24212 /* GetModuleGlobalName */
24213  static CYTHON_INLINE PyObject *__Pyx_GetModuleGlobalName(PyObject *name) {
24214  PyObject *result;
24215 #if !CYTHON_AVOID_BORROWED_REFS
24216 #if CYTHON_COMPILING_IN_CPYTHON && PY_VERSION_HEX >= 0x030500A1
24217  result = _PyDict_GetItem_KnownHash(__pyx_d, name, ((PyASCIIObject *) name)->hash);
24218  if (likely(result)) {
24219  Py_INCREF(result);
24220  } else if (unlikely(PyErr_Occurred())) {
24221  result = NULL;
24222  } else {
24223 #else
24224  result = PyDict_GetItem(__pyx_d, name);
24225  if (likely(result)) {
24226  Py_INCREF(result);
24227  } else {
24228 #endif
24229 #else
24230  result = PyObject_GetItem(__pyx_d, name);
24231  if (!result) {
24232  PyErr_Clear();
24233 #endif
24234  result = __Pyx_GetBuiltinName(name);
24235  }
24236  return result;
24237 }
24238 
24239 /* KeywordStringCheck */
24240  static int __Pyx_CheckKeywordStrings(
24241  PyObject *kwdict,
24242  const char* function_name,
24243  int kw_allowed)
24244 {
24245  PyObject* key = 0;
24246  Py_ssize_t pos = 0;
24247 #if CYTHON_COMPILING_IN_PYPY
24248  if (!kw_allowed && PyDict_Next(kwdict, &pos, &key, 0))
24249  goto invalid_keyword;
24250  return 1;
24251 #else
24252  while (PyDict_Next(kwdict, &pos, &key, 0)) {
24253  #if PY_MAJOR_VERSION < 3
24254  if (unlikely(!PyString_Check(key)))
24255  #endif
24256  if (unlikely(!PyUnicode_Check(key)))
24257  goto invalid_keyword_type;
24258  }
24259  if ((!kw_allowed) && unlikely(key))
24260  goto invalid_keyword;
24261  return 1;
24262 invalid_keyword_type:
24263  PyErr_Format(PyExc_TypeError,
24264  "%.200s() keywords must be strings", function_name);
24265  return 0;
24266 #endif
24267 invalid_keyword:
24268  PyErr_Format(PyExc_TypeError,
24269  #if PY_MAJOR_VERSION < 3
24270  "%.200s() got an unexpected keyword argument '%.200s'",
24271  function_name, PyString_AsString(key));
24272  #else
24273  "%s() got an unexpected keyword argument '%U'",
24274  function_name, key);
24275  #endif
24276  return 0;
24277 }
24278 
24279 /* WriteUnraisableException */
24280  static void __Pyx_WriteUnraisable(const char *name, CYTHON_UNUSED int clineno,
24281  CYTHON_UNUSED int lineno, CYTHON_UNUSED const char *filename,
24282  int full_traceback, CYTHON_UNUSED int nogil) {
24283  PyObject *old_exc, *old_val, *old_tb;
24284  PyObject *ctx;
24285  __Pyx_PyThreadState_declare
24286 #ifdef WITH_THREAD
24287  PyGILState_STATE state;
24288  if (nogil)
24289  state = PyGILState_Ensure();
24290 #ifdef _MSC_VER
24291  else state = (PyGILState_STATE)-1;
24292 #endif
24293 #endif
24294  __Pyx_PyThreadState_assign
24295  __Pyx_ErrFetch(&old_exc, &old_val, &old_tb);
24296  if (full_traceback) {
24297  Py_XINCREF(old_exc);
24298  Py_XINCREF(old_val);
24299  Py_XINCREF(old_tb);
24300  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24301  PyErr_PrintEx(1);
24302  }
24303  #if PY_MAJOR_VERSION < 3
24304  ctx = PyString_FromString(name);
24305  #else
24306  ctx = PyUnicode_FromString(name);
24307  #endif
24308  __Pyx_ErrRestore(old_exc, old_val, old_tb);
24309  if (!ctx) {
24310  PyErr_WriteUnraisable(Py_None);
24311  } else {
24312  PyErr_WriteUnraisable(ctx);
24313  Py_DECREF(ctx);
24314  }
24315 #ifdef WITH_THREAD
24316  if (nogil)
24317  PyGILState_Release(state);
24318 #endif
24319 }
24320 
24321 /* None */
24322  static CYTHON_INLINE void __Pyx_RaiseClosureNameError(const char *varname) {
24323  PyErr_Format(PyExc_NameError, "free variable '%s' referenced before assignment in enclosing scope", varname);
24324 }
24325 
24326 /* FetchCommonType */
24327  static PyTypeObject* __Pyx_FetchCommonType(PyTypeObject* type) {
24328  PyObject* fake_module;
24329  PyTypeObject* cached_type = NULL;
24330  fake_module = PyImport_AddModule((char*) "_cython_" CYTHON_ABI);
24331  if (!fake_module) return NULL;
24332  Py_INCREF(fake_module);
24333  cached_type = (PyTypeObject*) PyObject_GetAttrString(fake_module, type->tp_name);
24334  if (cached_type) {
24335  if (!PyType_Check((PyObject*)cached_type)) {
24336  PyErr_Format(PyExc_TypeError,
24337  "Shared Cython type %.200s is not a type object",
24338  type->tp_name);
24339  goto bad;
24340  }
24341  if (cached_type->tp_basicsize != type->tp_basicsize) {
24342  PyErr_Format(PyExc_TypeError,
24343  "Shared Cython type %.200s has the wrong size, try recompiling",
24344  type->tp_name);
24345  goto bad;
24346  }
24347  } else {
24348  if (!PyErr_ExceptionMatches(PyExc_AttributeError)) goto bad;
24349  PyErr_Clear();
24350  if (PyType_Ready(type) < 0) goto bad;
24351  if (PyObject_SetAttrString(fake_module, type->tp_name, (PyObject*) type) < 0)
24352  goto bad;
24353  Py_INCREF(type);
24354  cached_type = type;
24355  }
24356 done:
24357  Py_DECREF(fake_module);
24358  return cached_type;
24359 bad:
24360  Py_XDECREF(cached_type);
24361  cached_type = NULL;
24362  goto done;
24363 }
24364 
24365 /* CythonFunction */
24366  #include <structmember.h>
24367 static PyObject *
24368 __Pyx_CyFunction_get_doc(__pyx_CyFunctionObject *op, CYTHON_UNUSED void *closure)
24369 {
24370  if (unlikely(op->func_doc == NULL)) {
24371  if (op->func.m_ml->ml_doc) {
24372 #if PY_MAJOR_VERSION >= 3
24373  op->func_doc = PyUnicode_FromString(op->func.m_ml->ml_doc);
24374 #else
24375  op->func_doc = PyString_FromString(op->func.m_ml->ml_doc);
24376 #endif
24377  if (unlikely(op->func_doc == NULL))
24378  return NULL;
24379  } else {
24380  Py_INCREF(Py_None);
24381  return Py_None;
24382  }
24383  }
24384  Py_INCREF(op->func_doc);
24385  return op->func_doc;
24386 }
24387 static int
24388 __Pyx_CyFunction_set_doc(__pyx_CyFunctionObject *op, PyObject *value)
24389 {
24390  PyObject *tmp = op->func_doc;
24391  if (value == NULL) {
24392  value = Py_None;
24393  }
24394  Py_INCREF(value);
24395  op->func_doc = value;
24396  Py_XDECREF(tmp);
24397  return 0;
24398 }
24399 static PyObject *
24400 __Pyx_CyFunction_get_name(__pyx_CyFunctionObject *op)
24401 {
24402  if (unlikely(op->func_name == NULL)) {
24403 #if PY_MAJOR_VERSION >= 3
24404  op->func_name = PyUnicode_InternFromString(op->func.m_ml->ml_name);
24405 #else
24406  op->func_name = PyString_InternFromString(op->func.m_ml->ml_name);
24407 #endif
24408  if (unlikely(op->func_name == NULL))
24409  return NULL;
24410  }
24411  Py_INCREF(op->func_name);
24412  return op->func_name;
24413 }
24414 static int
24415 __Pyx_CyFunction_set_name(__pyx_CyFunctionObject *op, PyObject *value)
24416 {
24417  PyObject *tmp;
24418 #if PY_MAJOR_VERSION >= 3
24419  if (unlikely(value == NULL || !PyUnicode_Check(value))) {
24420 #else
24421  if (unlikely(value == NULL || !PyString_Check(value))) {
24422 #endif
24423  PyErr_SetString(PyExc_TypeError,
24424  "__name__ must be set to a string object");
24425  return -1;
24426  }
24427  tmp = op->func_name;
24428  Py_INCREF(value);
24429  op->func_name = value;
24430  Py_XDECREF(tmp);
24431  return 0;
24432 }
24433 static PyObject *
24434 __Pyx_CyFunction_get_qualname(__pyx_CyFunctionObject *op)
24435 {
24436  Py_INCREF(op->func_qualname);
24437  return op->func_qualname;
24438 }
24439 static int
24440 __Pyx_CyFunction_set_qualname(__pyx_CyFunctionObject *op, PyObject *value)
24441 {
24442  PyObject *tmp;
24443 #if PY_MAJOR_VERSION >= 3
24444  if (unlikely(value == NULL || !PyUnicode_Check(value))) {
24445 #else
24446  if (unlikely(value == NULL || !PyString_Check(value))) {
24447 #endif
24448  PyErr_SetString(PyExc_TypeError,
24449  "__qualname__ must be set to a string object");
24450  return -1;
24451  }
24452  tmp = op->func_qualname;
24453  Py_INCREF(value);
24454  op->func_qualname = value;
24455  Py_XDECREF(tmp);
24456  return 0;
24457 }
24458 static PyObject *
24459 __Pyx_CyFunction_get_self(__pyx_CyFunctionObject *m, CYTHON_UNUSED void *closure)
24460 {
24461  PyObject *self;
24462  self = m->func_closure;
24463  if (self == NULL)
24464  self = Py_None;
24465  Py_INCREF(self);
24466  return self;
24467 }
24468 static PyObject *
24469 __Pyx_CyFunction_get_dict(__pyx_CyFunctionObject *op)
24470 {
24471  if (unlikely(op->func_dict == NULL)) {
24472  op->func_dict = PyDict_New();
24473  if (unlikely(op->func_dict == NULL))
24474  return NULL;
24475  }
24476  Py_INCREF(op->func_dict);
24477  return op->func_dict;
24478 }
24479 static int
24480 __Pyx_CyFunction_set_dict(__pyx_CyFunctionObject *op, PyObject *value)
24481 {
24482  PyObject *tmp;
24483  if (unlikely(value == NULL)) {
24484  PyErr_SetString(PyExc_TypeError,
24485  "function's dictionary may not be deleted");
24486  return -1;
24487  }
24488  if (unlikely(!PyDict_Check(value))) {
24489  PyErr_SetString(PyExc_TypeError,
24490  "setting function's dictionary to a non-dict");
24491  return -1;
24492  }
24493  tmp = op->func_dict;
24494  Py_INCREF(value);
24495  op->func_dict = value;
24496  Py_XDECREF(tmp);
24497  return 0;
24498 }
24499 static PyObject *
24500 __Pyx_CyFunction_get_globals(__pyx_CyFunctionObject *op)
24501 {
24502  Py_INCREF(op->func_globals);
24503  return op->func_globals;
24504 }
24505 static PyObject *
24506 __Pyx_CyFunction_get_closure(CYTHON_UNUSED __pyx_CyFunctionObject *op)
24507 {
24508  Py_INCREF(Py_None);
24509  return Py_None;
24510 }
24511 static PyObject *
24512 __Pyx_CyFunction_get_code(__pyx_CyFunctionObject *op)
24513 {
24514  PyObject* result = (op->func_code) ? op->func_code : Py_None;
24515  Py_INCREF(result);
24516  return result;
24517 }
24518 static int
24519 __Pyx_CyFunction_init_defaults(__pyx_CyFunctionObject *op) {
24520  int result = 0;
24521  PyObject *res = op->defaults_getter((PyObject *) op);
24522  if (unlikely(!res))
24523  return -1;
24524  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24525  op->defaults_tuple = PyTuple_GET_ITEM(res, 0);
24526  Py_INCREF(op->defaults_tuple);
24527  op->defaults_kwdict = PyTuple_GET_ITEM(res, 1);
24528  Py_INCREF(op->defaults_kwdict);
24529  #else
24530  op->defaults_tuple = PySequence_ITEM(res, 0);
24531  if (unlikely(!op->defaults_tuple)) result = -1;
24532  else {
24533  op->defaults_kwdict = PySequence_ITEM(res, 1);
24534  if (unlikely(!op->defaults_kwdict)) result = -1;
24535  }
24536  #endif
24537  Py_DECREF(res);
24538  return result;
24539 }
24540 static int
24541 __Pyx_CyFunction_set_defaults(__pyx_CyFunctionObject *op, PyObject* value) {
24542  PyObject* tmp;
24543  if (!value) {
24544  value = Py_None;
24545  } else if (value != Py_None && !PyTuple_Check(value)) {
24546  PyErr_SetString(PyExc_TypeError,
24547  "__defaults__ must be set to a tuple object");
24548  return -1;
24549  }
24550  Py_INCREF(value);
24551  tmp = op->defaults_tuple;
24552  op->defaults_tuple = value;
24553  Py_XDECREF(tmp);
24554  return 0;
24555 }
24556 static PyObject *
24557 __Pyx_CyFunction_get_defaults(__pyx_CyFunctionObject *op) {
24558  PyObject* result = op->defaults_tuple;
24559  if (unlikely(!result)) {
24560  if (op->defaults_getter) {
24561  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
24562  result = op->defaults_tuple;
24563  } else {
24564  result = Py_None;
24565  }
24566  }
24567  Py_INCREF(result);
24568  return result;
24569 }
24570 static int
24571 __Pyx_CyFunction_set_kwdefaults(__pyx_CyFunctionObject *op, PyObject* value) {
24572  PyObject* tmp;
24573  if (!value) {
24574  value = Py_None;
24575  } else if (value != Py_None && !PyDict_Check(value)) {
24576  PyErr_SetString(PyExc_TypeError,
24577  "__kwdefaults__ must be set to a dict object");
24578  return -1;
24579  }
24580  Py_INCREF(value);
24581  tmp = op->defaults_kwdict;
24582  op->defaults_kwdict = value;
24583  Py_XDECREF(tmp);
24584  return 0;
24585 }
24586 static PyObject *
24587 __Pyx_CyFunction_get_kwdefaults(__pyx_CyFunctionObject *op) {
24588  PyObject* result = op->defaults_kwdict;
24589  if (unlikely(!result)) {
24590  if (op->defaults_getter) {
24591  if (__Pyx_CyFunction_init_defaults(op) < 0) return NULL;
24592  result = op->defaults_kwdict;
24593  } else {
24594  result = Py_None;
24595  }
24596  }
24597  Py_INCREF(result);
24598  return result;
24599 }
24600 static int
24601 __Pyx_CyFunction_set_annotations(__pyx_CyFunctionObject *op, PyObject* value) {
24602  PyObject* tmp;
24603  if (!value || value == Py_None) {
24604  value = NULL;
24605  } else if (!PyDict_Check(value)) {
24606  PyErr_SetString(PyExc_TypeError,
24607  "__annotations__ must be set to a dict object");
24608  return -1;
24609  }
24610  Py_XINCREF(value);
24611  tmp = op->func_annotations;
24612  op->func_annotations = value;
24613  Py_XDECREF(tmp);
24614  return 0;
24615 }
24616 static PyObject *
24617 __Pyx_CyFunction_get_annotations(__pyx_CyFunctionObject *op) {
24618  PyObject* result = op->func_annotations;
24619  if (unlikely(!result)) {
24620  result = PyDict_New();
24621  if (unlikely(!result)) return NULL;
24622  op->func_annotations = result;
24623  }
24624  Py_INCREF(result);
24625  return result;
24626 }
24627 static PyGetSetDef __pyx_CyFunction_getsets[] = {
24628  {(char *) "func_doc", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24629  {(char *) "__doc__", (getter)__Pyx_CyFunction_get_doc, (setter)__Pyx_CyFunction_set_doc, 0, 0},
24630  {(char *) "func_name", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24631  {(char *) "__name__", (getter)__Pyx_CyFunction_get_name, (setter)__Pyx_CyFunction_set_name, 0, 0},
24632  {(char *) "__qualname__", (getter)__Pyx_CyFunction_get_qualname, (setter)__Pyx_CyFunction_set_qualname, 0, 0},
24633  {(char *) "__self__", (getter)__Pyx_CyFunction_get_self, 0, 0, 0},
24634  {(char *) "func_dict", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24635  {(char *) "__dict__", (getter)__Pyx_CyFunction_get_dict, (setter)__Pyx_CyFunction_set_dict, 0, 0},
24636  {(char *) "func_globals", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24637  {(char *) "__globals__", (getter)__Pyx_CyFunction_get_globals, 0, 0, 0},
24638  {(char *) "func_closure", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24639  {(char *) "__closure__", (getter)__Pyx_CyFunction_get_closure, 0, 0, 0},
24640  {(char *) "func_code", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24641  {(char *) "__code__", (getter)__Pyx_CyFunction_get_code, 0, 0, 0},
24642  {(char *) "func_defaults", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24643  {(char *) "__defaults__", (getter)__Pyx_CyFunction_get_defaults, (setter)__Pyx_CyFunction_set_defaults, 0, 0},
24644  {(char *) "__kwdefaults__", (getter)__Pyx_CyFunction_get_kwdefaults, (setter)__Pyx_CyFunction_set_kwdefaults, 0, 0},
24645  {(char *) "__annotations__", (getter)__Pyx_CyFunction_get_annotations, (setter)__Pyx_CyFunction_set_annotations, 0, 0},
24646  {0, 0, 0, 0, 0}
24647 };
24648 static PyMemberDef __pyx_CyFunction_members[] = {
24649  {(char *) "__module__", T_OBJECT, offsetof(PyCFunctionObject, m_module), PY_WRITE_RESTRICTED, 0},
24650  {0, 0, 0, 0, 0}
24651 };
24652 static PyObject *
24653 __Pyx_CyFunction_reduce(__pyx_CyFunctionObject *m, CYTHON_UNUSED PyObject *args)
24654 {
24655 #if PY_MAJOR_VERSION >= 3
24656  return PyUnicode_FromString(m->func.m_ml->ml_name);
24657 #else
24658  return PyString_FromString(m->func.m_ml->ml_name);
24659 #endif
24660 }
24661 static PyMethodDef __pyx_CyFunction_methods[] = {
24662  {"__reduce__", (PyCFunction)__Pyx_CyFunction_reduce, METH_VARARGS, 0},
24663  {0, 0, 0, 0}
24664 };
24665 #if PY_VERSION_HEX < 0x030500A0
24666 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func_weakreflist)
24667 #else
24668 #define __Pyx_CyFunction_weakreflist(cyfunc) ((cyfunc)->func.m_weakreflist)
24669 #endif
24670 static PyObject *__Pyx_CyFunction_New(PyTypeObject *type, PyMethodDef *ml, int flags, PyObject* qualname,
24671  PyObject *closure, PyObject *module, PyObject* globals, PyObject* code) {
24672  __pyx_CyFunctionObject *op = PyObject_GC_New(__pyx_CyFunctionObject, type);
24673  if (op == NULL)
24674  return NULL;
24675  op->flags = flags;
24676  __Pyx_CyFunction_weakreflist(op) = NULL;
24677  op->func.m_ml = ml;
24678  op->func.m_self = (PyObject *) op;
24679  Py_XINCREF(closure);
24680  op->func_closure = closure;
24681  Py_XINCREF(module);
24682  op->func.m_module = module;
24683  op->func_dict = NULL;
24684  op->func_name = NULL;
24685  Py_INCREF(qualname);
24686  op->func_qualname = qualname;
24687  op->func_doc = NULL;
24688  op->func_classobj = NULL;
24689  op->func_globals = globals;
24690  Py_INCREF(op->func_globals);
24691  Py_XINCREF(code);
24692  op->func_code = code;
24693  op->defaults_pyobjects = 0;
24694  op->defaults = NULL;
24695  op->defaults_tuple = NULL;
24696  op->defaults_kwdict = NULL;
24697  op->defaults_getter = NULL;
24698  op->func_annotations = NULL;
24699  PyObject_GC_Track(op);
24700  return (PyObject *) op;
24701 }
24702 static int
24703 __Pyx_CyFunction_clear(__pyx_CyFunctionObject *m)
24704 {
24705  Py_CLEAR(m->func_closure);
24706  Py_CLEAR(m->func.m_module);
24707  Py_CLEAR(m->func_dict);
24708  Py_CLEAR(m->func_name);
24709  Py_CLEAR(m->func_qualname);
24710  Py_CLEAR(m->func_doc);
24711  Py_CLEAR(m->func_globals);
24712  Py_CLEAR(m->func_code);
24713  Py_CLEAR(m->func_classobj);
24714  Py_CLEAR(m->defaults_tuple);
24715  Py_CLEAR(m->defaults_kwdict);
24716  Py_CLEAR(m->func_annotations);
24717  if (m->defaults) {
24718  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
24719  int i;
24720  for (i = 0; i < m->defaults_pyobjects; i++)
24721  Py_XDECREF(pydefaults[i]);
24722  PyObject_Free(m->defaults);
24723  m->defaults = NULL;
24724  }
24725  return 0;
24726 }
24727 static void __Pyx__CyFunction_dealloc(__pyx_CyFunctionObject *m)
24728 {
24729  if (__Pyx_CyFunction_weakreflist(m) != NULL)
24730  PyObject_ClearWeakRefs((PyObject *) m);
24731  __Pyx_CyFunction_clear(m);
24732  PyObject_GC_Del(m);
24733 }
24734 static void __Pyx_CyFunction_dealloc(__pyx_CyFunctionObject *m)
24735 {
24736  PyObject_GC_UnTrack(m);
24737  __Pyx__CyFunction_dealloc(m);
24738 }
24739 static int __Pyx_CyFunction_traverse(__pyx_CyFunctionObject *m, visitproc visit, void *arg)
24740 {
24741  Py_VISIT(m->func_closure);
24742  Py_VISIT(m->func.m_module);
24743  Py_VISIT(m->func_dict);
24744  Py_VISIT(m->func_name);
24745  Py_VISIT(m->func_qualname);
24746  Py_VISIT(m->func_doc);
24747  Py_VISIT(m->func_globals);
24748  Py_VISIT(m->func_code);
24749  Py_VISIT(m->func_classobj);
24750  Py_VISIT(m->defaults_tuple);
24751  Py_VISIT(m->defaults_kwdict);
24752  if (m->defaults) {
24753  PyObject **pydefaults = __Pyx_CyFunction_Defaults(PyObject *, m);
24754  int i;
24755  for (i = 0; i < m->defaults_pyobjects; i++)
24756  Py_VISIT(pydefaults[i]);
24757  }
24758  return 0;
24759 }
24760 static PyObject *__Pyx_CyFunction_descr_get(PyObject *func, PyObject *obj, PyObject *type)
24761 {
24762  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24763  if (m->flags & __Pyx_CYFUNCTION_STATICMETHOD) {
24764  Py_INCREF(func);
24765  return func;
24766  }
24767  if (m->flags & __Pyx_CYFUNCTION_CLASSMETHOD) {
24768  if (type == NULL)
24769  type = (PyObject *)(Py_TYPE(obj));
24770  return __Pyx_PyMethod_New(func, type, (PyObject *)(Py_TYPE(type)));
24771  }
24772  if (obj == Py_None)
24773  obj = NULL;
24774  return __Pyx_PyMethod_New(func, obj, type);
24775 }
24776 static PyObject*
24777 __Pyx_CyFunction_repr(__pyx_CyFunctionObject *op)
24778 {
24779 #if PY_MAJOR_VERSION >= 3
24780  return PyUnicode_FromFormat("<cyfunction %U at %p>",
24781  op->func_qualname, (void *)op);
24782 #else
24783  return PyString_FromFormat("<cyfunction %s at %p>",
24784  PyString_AsString(op->func_qualname), (void *)op);
24785 #endif
24786 }
24787 static PyObject * __Pyx_CyFunction_CallMethod(PyObject *func, PyObject *self, PyObject *arg, PyObject *kw) {
24788  PyCFunctionObject* f = (PyCFunctionObject*)func;
24789  PyCFunction meth = f->m_ml->ml_meth;
24790  Py_ssize_t size;
24791  switch (f->m_ml->ml_flags & (METH_VARARGS | METH_KEYWORDS | METH_NOARGS | METH_O)) {
24792  case METH_VARARGS:
24793  if (likely(kw == NULL || PyDict_Size(kw) == 0))
24794  return (*meth)(self, arg);
24795  break;
24796  case METH_VARARGS | METH_KEYWORDS:
24797  return (*(PyCFunctionWithKeywords)meth)(self, arg, kw);
24798  case METH_NOARGS:
24799  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
24800  size = PyTuple_GET_SIZE(arg);
24801  if (likely(size == 0))
24802  return (*meth)(self, NULL);
24803  PyErr_Format(PyExc_TypeError,
24804  "%.200s() takes no arguments (%" CYTHON_FORMAT_SSIZE_T "d given)",
24805  f->m_ml->ml_name, size);
24806  return NULL;
24807  }
24808  break;
24809  case METH_O:
24810  if (likely(kw == NULL || PyDict_Size(kw) == 0)) {
24811  size = PyTuple_GET_SIZE(arg);
24812  if (likely(size == 1)) {
24813  PyObject *result, *arg0;
24814  #if CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS
24815  arg0 = PyTuple_GET_ITEM(arg, 0);
24816  #else
24817  arg0 = PySequence_ITEM(arg, 0); if (unlikely(!arg0)) return NULL;
24818  #endif
24819  result = (*meth)(self, arg0);
24820  #if !(CYTHON_ASSUME_SAFE_MACROS && !CYTHON_AVOID_BORROWED_REFS)
24821  Py_DECREF(arg0);
24822  #endif
24823  return result;
24824  }
24825  PyErr_Format(PyExc_TypeError,
24826  "%.200s() takes exactly one argument (%" CYTHON_FORMAT_SSIZE_T "d given)",
24827  f->m_ml->ml_name, size);
24828  return NULL;
24829  }
24830  break;
24831  default:
24832  PyErr_SetString(PyExc_SystemError, "Bad call flags in "
24833  "__Pyx_CyFunction_Call. METH_OLDARGS is no "
24834  "longer supported!");
24835  return NULL;
24836  }
24837  PyErr_Format(PyExc_TypeError, "%.200s() takes no keyword arguments",
24838  f->m_ml->ml_name);
24839  return NULL;
24840 }
24841 static CYTHON_INLINE PyObject *__Pyx_CyFunction_Call(PyObject *func, PyObject *arg, PyObject *kw) {
24842  return __Pyx_CyFunction_CallMethod(func, ((PyCFunctionObject*)func)->m_self, arg, kw);
24843 }
24844 static PyObject *__Pyx_CyFunction_CallAsMethod(PyObject *func, PyObject *args, PyObject *kw) {
24845  PyObject *result;
24846  __pyx_CyFunctionObject *cyfunc = (__pyx_CyFunctionObject *) func;
24847  if ((cyfunc->flags & __Pyx_CYFUNCTION_CCLASS) && !(cyfunc->flags & __Pyx_CYFUNCTION_STATICMETHOD)) {
24848  Py_ssize_t argc;
24849  PyObject *new_args;
24850  PyObject *self;
24851  argc = PyTuple_GET_SIZE(args);
24852  new_args = PyTuple_GetSlice(args, 1, argc);
24853  if (unlikely(!new_args))
24854  return NULL;
24855  self = PyTuple_GetItem(args, 0);
24856  if (unlikely(!self)) {
24857  Py_DECREF(new_args);
24858  return NULL;
24859  }
24860  result = __Pyx_CyFunction_CallMethod(func, self, new_args, kw);
24861  Py_DECREF(new_args);
24862  } else {
24863  result = __Pyx_CyFunction_Call(func, args, kw);
24864  }
24865  return result;
24866 }
24867 static PyTypeObject __pyx_CyFunctionType_type = {
24868  PyVarObject_HEAD_INIT(0, 0)
24869  "cython_function_or_method",
24870  sizeof(__pyx_CyFunctionObject),
24871  0,
24872  (destructor) __Pyx_CyFunction_dealloc,
24873  0,
24874  0,
24875  0,
24876 #if PY_MAJOR_VERSION < 3
24877  0,
24878 #else
24879  0,
24880 #endif
24881  (reprfunc) __Pyx_CyFunction_repr,
24882  0,
24883  0,
24884  0,
24885  0,
24886  __Pyx_CyFunction_CallAsMethod,
24887  0,
24888  0,
24889  0,
24890  0,
24891  Py_TPFLAGS_DEFAULT | Py_TPFLAGS_HAVE_GC,
24892  0,
24893  (traverseproc) __Pyx_CyFunction_traverse,
24894  (inquiry) __Pyx_CyFunction_clear,
24895  0,
24896 #if PY_VERSION_HEX < 0x030500A0
24897  offsetof(__pyx_CyFunctionObject, func_weakreflist),
24898 #else
24899  offsetof(PyCFunctionObject, m_weakreflist),
24900 #endif
24901  0,
24902  0,
24903  __pyx_CyFunction_methods,
24904  __pyx_CyFunction_members,
24905  __pyx_CyFunction_getsets,
24906  0,
24907  0,
24908  __Pyx_CyFunction_descr_get,
24909  0,
24910  offsetof(__pyx_CyFunctionObject, func_dict),
24911  0,
24912  0,
24913  0,
24914  0,
24915  0,
24916  0,
24917  0,
24918  0,
24919  0,
24920  0,
24921  0,
24922  0,
24923 #if PY_VERSION_HEX >= 0x030400a1
24924  0,
24925 #endif
24926 };
24927 static int __pyx_CyFunction_init(void) {
24928  __pyx_CyFunctionType = __Pyx_FetchCommonType(&__pyx_CyFunctionType_type);
24929  if (unlikely(__pyx_CyFunctionType == NULL)) {
24930  return -1;
24931  }
24932  return 0;
24933 }
24934 static CYTHON_INLINE void *__Pyx_CyFunction_InitDefaults(PyObject *func, size_t size, int pyobjects) {
24935  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24936  m->defaults = PyObject_Malloc(size);
24937  if (unlikely(!m->defaults))
24938  return PyErr_NoMemory();
24939  memset(m->defaults, 0, size);
24940  m->defaults_pyobjects = pyobjects;
24941  return m->defaults;
24942 }
24943 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsTuple(PyObject *func, PyObject *tuple) {
24944  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24945  m->defaults_tuple = tuple;
24946  Py_INCREF(tuple);
24947 }
24948 static CYTHON_INLINE void __Pyx_CyFunction_SetDefaultsKwDict(PyObject *func, PyObject *dict) {
24949  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24950  m->defaults_kwdict = dict;
24951  Py_INCREF(dict);
24952 }
24953 static CYTHON_INLINE void __Pyx_CyFunction_SetAnnotationsDict(PyObject *func, PyObject *dict) {
24954  __pyx_CyFunctionObject *m = (__pyx_CyFunctionObject *) func;
24955  m->func_annotations = dict;
24956  Py_INCREF(dict);
24957 }
24958 
24959 /* RaiseException */
24960  #if PY_MAJOR_VERSION < 3
24961 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb,
24962  CYTHON_UNUSED PyObject *cause) {
24963  __Pyx_PyThreadState_declare
24964  Py_XINCREF(type);
24965  if (!value || value == Py_None)
24966  value = NULL;
24967  else
24968  Py_INCREF(value);
24969  if (!tb || tb == Py_None)
24970  tb = NULL;
24971  else {
24972  Py_INCREF(tb);
24973  if (!PyTraceBack_Check(tb)) {
24974  PyErr_SetString(PyExc_TypeError,
24975  "raise: arg 3 must be a traceback or None");
24976  goto raise_error;
24977  }
24978  }
24979  if (PyType_Check(type)) {
24980 #if CYTHON_COMPILING_IN_PYPY
24981  if (!value) {
24982  Py_INCREF(Py_None);
24983  value = Py_None;
24984  }
24985 #endif
24986  PyErr_NormalizeException(&type, &value, &tb);
24987  } else {
24988  if (value) {
24989  PyErr_SetString(PyExc_TypeError,
24990  "instance exception may not have a separate value");
24991  goto raise_error;
24992  }
24993  value = type;
24994  type = (PyObject*) Py_TYPE(type);
24995  Py_INCREF(type);
24996  if (!PyType_IsSubtype((PyTypeObject *)type, (PyTypeObject *)PyExc_BaseException)) {
24997  PyErr_SetString(PyExc_TypeError,
24998  "raise: exception class must be a subclass of BaseException");
24999  goto raise_error;
25000  }
25001  }
25002  __Pyx_PyThreadState_assign
25003  __Pyx_ErrRestore(type, value, tb);
25004  return;
25005 raise_error:
25006  Py_XDECREF(value);
25007  Py_XDECREF(type);
25008  Py_XDECREF(tb);
25009  return;
25010 }
25011 #else
25012 static void __Pyx_Raise(PyObject *type, PyObject *value, PyObject *tb, PyObject *cause) {
25013  PyObject* owned_instance = NULL;
25014  if (tb == Py_None) {
25015  tb = 0;
25016  } else if (tb && !PyTraceBack_Check(tb)) {
25017  PyErr_SetString(PyExc_TypeError,
25018  "raise: arg 3 must be a traceback or None");
25019  goto bad;
25020  }
25021  if (value == Py_None)
25022  value = 0;
25023  if (PyExceptionInstance_Check(type)) {
25024  if (value) {
25025  PyErr_SetString(PyExc_TypeError,
25026  "instance exception may not have a separate value");
25027  goto bad;
25028  }
25029  value = type;
25030  type = (PyObject*) Py_TYPE(value);
25031  } else if (PyExceptionClass_Check(type)) {
25032  PyObject *instance_class = NULL;
25033  if (value && PyExceptionInstance_Check(value)) {
25034  instance_class = (PyObject*) Py_TYPE(value);
25035  if (instance_class != type) {
25036  int is_subclass = PyObject_IsSubclass(instance_class, type);
25037  if (!is_subclass) {
25038  instance_class = NULL;
25039  } else if (unlikely(is_subclass == -1)) {
25040  goto bad;
25041  } else {
25042  type = instance_class;
25043  }
25044  }
25045  }
25046  if (!instance_class) {
25047  PyObject *args;
25048  if (!value)
25049  args = PyTuple_New(0);
25050  else if (PyTuple_Check(value)) {
25051  Py_INCREF(value);
25052  args = value;
25053  } else
25054  args = PyTuple_Pack(1, value);
25055  if (!args)
25056  goto bad;
25057  owned_instance = PyObject_Call(type, args, NULL);
25058  Py_DECREF(args);
25059  if (!owned_instance)
25060  goto bad;
25061  value = owned_instance;
25062  if (!PyExceptionInstance_Check(value)) {
25063  PyErr_Format(PyExc_TypeError,
25064  "calling %R should have returned an instance of "
25065  "BaseException, not %R",
25066  type, Py_TYPE(value));
25067  goto bad;
25068  }
25069  }
25070  } else {
25071  PyErr_SetString(PyExc_TypeError,
25072  "raise: exception class must be a subclass of BaseException");
25073  goto bad;
25074  }
25075  if (cause) {
25076  PyObject *fixed_cause;
25077  if (cause == Py_None) {
25078  fixed_cause = NULL;
25079  } else if (PyExceptionClass_Check(cause)) {
25080  fixed_cause = PyObject_CallObject(cause, NULL);
25081  if (fixed_cause == NULL)
25082  goto bad;
25083  } else if (PyExceptionInstance_Check(cause)) {
25084  fixed_cause = cause;
25085  Py_INCREF(fixed_cause);
25086  } else {
25087  PyErr_SetString(PyExc_TypeError,
25088  "exception causes must derive from "
25089  "BaseException");
25090  goto bad;
25091  }
25092  PyException_SetCause(value, fixed_cause);
25093  }
25094  PyErr_SetObject(type, value);
25095  if (tb) {
25096 #if CYTHON_COMPILING_IN_PYPY
25097  PyObject *tmp_type, *tmp_value, *tmp_tb;
25098  PyErr_Fetch(&tmp_type, &tmp_value, &tmp_tb);
25099  Py_INCREF(tb);
25100  PyErr_Restore(tmp_type, tmp_value, tb);
25101  Py_XDECREF(tmp_tb);
25102 #else
25103  PyThreadState *tstate = __Pyx_PyThreadState_Current;
25104  PyObject* tmp_tb = tstate->curexc_traceback;
25105  if (tb != tmp_tb) {
25106  Py_INCREF(tb);
25107  tstate->curexc_traceback = tb;
25108  Py_XDECREF(tmp_tb);
25109  }
25110 #endif
25111  }
25112 bad:
25113  Py_XDECREF(owned_instance);
25114  return;
25115 }
25116 #endif
25117 
25118 /* HasAttr */
25119  static CYTHON_INLINE int __Pyx_HasAttr(PyObject *o, PyObject *n) {
25120  PyObject *r;
25121  if (unlikely(!__Pyx_PyBaseString_Check(n))) {
25122  PyErr_SetString(PyExc_TypeError,
25123  "hasattr(): attribute name must be string");
25124  return -1;
25125  }
25126  r = __Pyx_GetAttr(o, n);
25127  if (unlikely(!r)) {
25128  PyErr_Clear();
25129  return 0;
25130  } else {
25131  Py_DECREF(r);
25132  return 1;
25133  }
25134 }
25135 
25136 /* DictGetItem */
25137  #if PY_MAJOR_VERSION >= 3 && !CYTHON_COMPILING_IN_PYPY
25138 static PyObject *__Pyx_PyDict_GetItem(PyObject *d, PyObject* key) {
25139  PyObject *value;
25140  value = PyDict_GetItemWithError(d, key);
25141  if (unlikely(!value)) {
25142  if (!PyErr_Occurred()) {
25143  PyObject* args = PyTuple_Pack(1, key);
25144  if (likely(args))
25145  PyErr_SetObject(PyExc_KeyError, args);
25146  Py_XDECREF(args);
25147  }
25148  return NULL;
25149  }
25150  Py_INCREF(value);
25151  return value;
25152 }
25153 #endif
25154 
25155 /* RaiseTooManyValuesToUnpack */
25156  static CYTHON_INLINE void __Pyx_RaiseTooManyValuesError(Py_ssize_t expected) {
25157  PyErr_Format(PyExc_ValueError,
25158  "too many values to unpack (expected %" CYTHON_FORMAT_SSIZE_T "d)", expected);
25159 }
25160 
25161 /* RaiseNeedMoreValuesToUnpack */
25162  static CYTHON_INLINE void __Pyx_RaiseNeedMoreValuesError(Py_ssize_t index) {
25163  PyErr_Format(PyExc_ValueError,
25164  "need more than %" CYTHON_FORMAT_SSIZE_T "d value%.1s to unpack",
25165  index, (index == 1) ? "" : "s");
25166 }
25167 
25168 /* RaiseNoneIterError */
25169  static CYTHON_INLINE void __Pyx_RaiseNoneNotIterableError(void) {
25170  PyErr_SetString(PyExc_TypeError, "'NoneType' object is not iterable");
25171 }
25172 
25173 /* ExtTypeTest */
25174  static CYTHON_INLINE int __Pyx_TypeTest(PyObject *obj, PyTypeObject *type) {
25175  if (unlikely(!type)) {
25176  PyErr_SetString(PyExc_SystemError, "Missing type object");
25177  return 0;
25178  }
25179  if (likely(__Pyx_TypeCheck(obj, type)))
25180  return 1;
25181  PyErr_Format(PyExc_TypeError, "Cannot convert %.200s to %.200s",
25182  Py_TYPE(obj)->tp_name, type->tp_name);
25183  return 0;
25184 }
25185 
25186 /* SaveResetException */
25187  #if CYTHON_FAST_THREAD_STATE
25188 static CYTHON_INLINE void __Pyx__ExceptionSave(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25189  #if PY_VERSION_HEX >= 0x030700A3
25190  *type = tstate->exc_state.exc_type;
25191  *value = tstate->exc_state.exc_value;
25192  *tb = tstate->exc_state.exc_traceback;
25193  #else
25194  *type = tstate->exc_type;
25195  *value = tstate->exc_value;
25196  *tb = tstate->exc_traceback;
25197  #endif
25198  Py_XINCREF(*type);
25199  Py_XINCREF(*value);
25200  Py_XINCREF(*tb);
25201 }
25202 static CYTHON_INLINE void __Pyx__ExceptionReset(PyThreadState *tstate, PyObject *type, PyObject *value, PyObject *tb) {
25203  PyObject *tmp_type, *tmp_value, *tmp_tb;
25204  #if PY_VERSION_HEX >= 0x030700A3
25205  tmp_type = tstate->exc_state.exc_type;
25206  tmp_value = tstate->exc_state.exc_value;
25207  tmp_tb = tstate->exc_state.exc_traceback;
25208  tstate->exc_state.exc_type = type;
25209  tstate->exc_state.exc_value = value;
25210  tstate->exc_state.exc_traceback = tb;
25211  #else
25212  tmp_type = tstate->exc_type;
25213  tmp_value = tstate->exc_value;
25214  tmp_tb = tstate->exc_traceback;
25215  tstate->exc_type = type;
25216  tstate->exc_value = value;
25217  tstate->exc_traceback = tb;
25218  #endif
25219  Py_XDECREF(tmp_type);
25220  Py_XDECREF(tmp_value);
25221  Py_XDECREF(tmp_tb);
25222 }
25223 #endif
25224 
25225 /* GetException */
25226  #if CYTHON_FAST_THREAD_STATE
25227 static int __Pyx__GetException(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25228 #else
25229 static int __Pyx_GetException(PyObject **type, PyObject **value, PyObject **tb) {
25230 #endif
25231  PyObject *local_type, *local_value, *local_tb;
25232 #if CYTHON_FAST_THREAD_STATE
25233  PyObject *tmp_type, *tmp_value, *tmp_tb;
25234  local_type = tstate->curexc_type;
25235  local_value = tstate->curexc_value;
25236  local_tb = tstate->curexc_traceback;
25237  tstate->curexc_type = 0;
25238  tstate->curexc_value = 0;
25239  tstate->curexc_traceback = 0;
25240 #else
25241  PyErr_Fetch(&local_type, &local_value, &local_tb);
25242 #endif
25243  PyErr_NormalizeException(&local_type, &local_value, &local_tb);
25244 #if CYTHON_FAST_THREAD_STATE
25245  if (unlikely(tstate->curexc_type))
25246 #else
25247  if (unlikely(PyErr_Occurred()))
25248 #endif
25249  goto bad;
25250  #if PY_MAJOR_VERSION >= 3
25251  if (local_tb) {
25252  if (unlikely(PyException_SetTraceback(local_value, local_tb) < 0))
25253  goto bad;
25254  }
25255  #endif
25256  Py_XINCREF(local_tb);
25257  Py_XINCREF(local_type);
25258  Py_XINCREF(local_value);
25259  *type = local_type;
25260  *value = local_value;
25261  *tb = local_tb;
25262 #if CYTHON_FAST_THREAD_STATE
25263  #if PY_VERSION_HEX >= 0x030700A3
25264  tmp_type = tstate->exc_state.exc_type;
25265  tmp_value = tstate->exc_state.exc_value;
25266  tmp_tb = tstate->exc_state.exc_traceback;
25267  tstate->exc_state.exc_type = local_type;
25268  tstate->exc_state.exc_value = local_value;
25269  tstate->exc_state.exc_traceback = local_tb;
25270  #else
25271  tmp_type = tstate->exc_type;
25272  tmp_value = tstate->exc_value;
25273  tmp_tb = tstate->exc_traceback;
25274  tstate->exc_type = local_type;
25275  tstate->exc_value = local_value;
25276  tstate->exc_traceback = local_tb;
25277  #endif
25278  Py_XDECREF(tmp_type);
25279  Py_XDECREF(tmp_value);
25280  Py_XDECREF(tmp_tb);
25281 #else
25282  PyErr_SetExcInfo(local_type, local_value, local_tb);
25283 #endif
25284  return 0;
25285 bad:
25286  *type = 0;
25287  *value = 0;
25288  *tb = 0;
25289  Py_XDECREF(local_type);
25290  Py_XDECREF(local_value);
25291  Py_XDECREF(local_tb);
25292  return -1;
25293 }
25294 
25295 /* ArgTypeTest */
25296  static int __Pyx__ArgTypeTest(PyObject *obj, PyTypeObject *type, const char *name, int exact)
25297 {
25298  if (unlikely(!type)) {
25299  PyErr_SetString(PyExc_SystemError, "Missing type object");
25300  return 0;
25301  }
25302  else if (exact) {
25303  #if PY_MAJOR_VERSION == 2
25304  if ((type == &PyBaseString_Type) && likely(__Pyx_PyBaseString_CheckExact(obj))) return 1;
25305  #endif
25306  }
25307  else {
25308  if (likely(__Pyx_TypeCheck(obj, type))) return 1;
25309  }
25310  PyErr_Format(PyExc_TypeError,
25311  "Argument '%.200s' has incorrect type (expected %.200s, got %.200s)",
25312  name, type->tp_name, Py_TYPE(obj)->tp_name);
25313  return 0;
25314 }
25315 
25316 /* BytesEquals */
25317  static CYTHON_INLINE int __Pyx_PyBytes_Equals(PyObject* s1, PyObject* s2, int equals) {
25318 #if CYTHON_COMPILING_IN_PYPY
25319  return PyObject_RichCompareBool(s1, s2, equals);
25320 #else
25321  if (s1 == s2) {
25322  return (equals == Py_EQ);
25323  } else if (PyBytes_CheckExact(s1) & PyBytes_CheckExact(s2)) {
25324  const char *ps1, *ps2;
25325  Py_ssize_t length = PyBytes_GET_SIZE(s1);
25326  if (length != PyBytes_GET_SIZE(s2))
25327  return (equals == Py_NE);
25328  ps1 = PyBytes_AS_STRING(s1);
25329  ps2 = PyBytes_AS_STRING(s2);
25330  if (ps1[0] != ps2[0]) {
25331  return (equals == Py_NE);
25332  } else if (length == 1) {
25333  return (equals == Py_EQ);
25334  } else {
25335  int result;
25336 #if CYTHON_USE_UNICODE_INTERNALS
25337  Py_hash_t hash1, hash2;
25338  hash1 = ((PyBytesObject*)s1)->ob_shash;
25339  hash2 = ((PyBytesObject*)s2)->ob_shash;
25340  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25341  return (equals == Py_NE);
25342  }
25343 #endif
25344  result = memcmp(ps1, ps2, (size_t)length);
25345  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25346  }
25347  } else if ((s1 == Py_None) & PyBytes_CheckExact(s2)) {
25348  return (equals == Py_NE);
25349  } else if ((s2 == Py_None) & PyBytes_CheckExact(s1)) {
25350  return (equals == Py_NE);
25351  } else {
25352  int result;
25353  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25354  if (!py_result)
25355  return -1;
25356  result = __Pyx_PyObject_IsTrue(py_result);
25357  Py_DECREF(py_result);
25358  return result;
25359  }
25360 #endif
25361 }
25362 
25363 /* UnicodeEquals */
25364  static CYTHON_INLINE int __Pyx_PyUnicode_Equals(PyObject* s1, PyObject* s2, int equals) {
25365 #if CYTHON_COMPILING_IN_PYPY
25366  return PyObject_RichCompareBool(s1, s2, equals);
25367 #else
25368 #if PY_MAJOR_VERSION < 3
25369  PyObject* owned_ref = NULL;
25370 #endif
25371  int s1_is_unicode, s2_is_unicode;
25372  if (s1 == s2) {
25373  goto return_eq;
25374  }
25375  s1_is_unicode = PyUnicode_CheckExact(s1);
25376  s2_is_unicode = PyUnicode_CheckExact(s2);
25377 #if PY_MAJOR_VERSION < 3
25378  if ((s1_is_unicode & (!s2_is_unicode)) && PyString_CheckExact(s2)) {
25379  owned_ref = PyUnicode_FromObject(s2);
25380  if (unlikely(!owned_ref))
25381  return -1;
25382  s2 = owned_ref;
25383  s2_is_unicode = 1;
25384  } else if ((s2_is_unicode & (!s1_is_unicode)) && PyString_CheckExact(s1)) {
25385  owned_ref = PyUnicode_FromObject(s1);
25386  if (unlikely(!owned_ref))
25387  return -1;
25388  s1 = owned_ref;
25389  s1_is_unicode = 1;
25390  } else if (((!s2_is_unicode) & (!s1_is_unicode))) {
25391  return __Pyx_PyBytes_Equals(s1, s2, equals);
25392  }
25393 #endif
25394  if (s1_is_unicode & s2_is_unicode) {
25395  Py_ssize_t length;
25396  int kind;
25397  void *data1, *data2;
25398  if (unlikely(__Pyx_PyUnicode_READY(s1) < 0) || unlikely(__Pyx_PyUnicode_READY(s2) < 0))
25399  return -1;
25400  length = __Pyx_PyUnicode_GET_LENGTH(s1);
25401  if (length != __Pyx_PyUnicode_GET_LENGTH(s2)) {
25402  goto return_ne;
25403  }
25404 #if CYTHON_USE_UNICODE_INTERNALS
25405  {
25406  Py_hash_t hash1, hash2;
25407  #if CYTHON_PEP393_ENABLED
25408  hash1 = ((PyASCIIObject*)s1)->hash;
25409  hash2 = ((PyASCIIObject*)s2)->hash;
25410  #else
25411  hash1 = ((PyUnicodeObject*)s1)->hash;
25412  hash2 = ((PyUnicodeObject*)s2)->hash;
25413  #endif
25414  if (hash1 != hash2 && hash1 != -1 && hash2 != -1) {
25415  goto return_ne;
25416  }
25417  }
25418 #endif
25419  kind = __Pyx_PyUnicode_KIND(s1);
25420  if (kind != __Pyx_PyUnicode_KIND(s2)) {
25421  goto return_ne;
25422  }
25423  data1 = __Pyx_PyUnicode_DATA(s1);
25424  data2 = __Pyx_PyUnicode_DATA(s2);
25425  if (__Pyx_PyUnicode_READ(kind, data1, 0) != __Pyx_PyUnicode_READ(kind, data2, 0)) {
25426  goto return_ne;
25427  } else if (length == 1) {
25428  goto return_eq;
25429  } else {
25430  int result = memcmp(data1, data2, (size_t)(length * kind));
25431  #if PY_MAJOR_VERSION < 3
25432  Py_XDECREF(owned_ref);
25433  #endif
25434  return (equals == Py_EQ) ? (result == 0) : (result != 0);
25435  }
25436  } else if ((s1 == Py_None) & s2_is_unicode) {
25437  goto return_ne;
25438  } else if ((s2 == Py_None) & s1_is_unicode) {
25439  goto return_ne;
25440  } else {
25441  int result;
25442  PyObject* py_result = PyObject_RichCompare(s1, s2, equals);
25443  #if PY_MAJOR_VERSION < 3
25444  Py_XDECREF(owned_ref);
25445  #endif
25446  if (!py_result)
25447  return -1;
25448  result = __Pyx_PyObject_IsTrue(py_result);
25449  Py_DECREF(py_result);
25450  return result;
25451  }
25452 return_eq:
25453  #if PY_MAJOR_VERSION < 3
25454  Py_XDECREF(owned_ref);
25455  #endif
25456  return (equals == Py_EQ);
25457 return_ne:
25458  #if PY_MAJOR_VERSION < 3
25459  Py_XDECREF(owned_ref);
25460  #endif
25461  return (equals == Py_NE);
25462 #endif
25463 }
25464 
25465 /* None */
25466  static CYTHON_INLINE Py_ssize_t __Pyx_div_Py_ssize_t(Py_ssize_t a, Py_ssize_t b) {
25467  Py_ssize_t q = a / b;
25468  Py_ssize_t r = a - q*b;
25469  q -= ((r != 0) & ((r ^ b) < 0));
25470  return q;
25471 }
25472 
25473 /* decode_c_string */
25474  static CYTHON_INLINE PyObject* __Pyx_decode_c_string(
25475  const char* cstring, Py_ssize_t start, Py_ssize_t stop,
25476  const char* encoding, const char* errors,
25477  PyObject* (*decode_func)(const char *s, Py_ssize_t size, const char *errors)) {
25478  Py_ssize_t length;
25479  if (unlikely((start < 0) | (stop < 0))) {
25480  size_t slen = strlen(cstring);
25481  if (unlikely(slen > (size_t) PY_SSIZE_T_MAX)) {
25482  PyErr_SetString(PyExc_OverflowError,
25483  "c-string too long to convert to Python");
25484  return NULL;
25485  }
25486  length = (Py_ssize_t) slen;
25487  if (start < 0) {
25488  start += length;
25489  if (start < 0)
25490  start = 0;
25491  }
25492  if (stop < 0)
25493  stop += length;
25494  }
25495  length = stop - start;
25496  if (unlikely(length <= 0))
25497  return PyUnicode_FromUnicode(NULL, 0);
25498  cstring += start;
25499  if (decode_func) {
25500  return decode_func(cstring, length, errors);
25501  } else {
25502  return PyUnicode_Decode(cstring, length, encoding, errors);
25503  }
25504 }
25505 
25506 /* SwapException */
25507  #if CYTHON_FAST_THREAD_STATE
25508 static CYTHON_INLINE void __Pyx__ExceptionSwap(PyThreadState *tstate, PyObject **type, PyObject **value, PyObject **tb) {
25509  PyObject *tmp_type, *tmp_value, *tmp_tb;
25510  #if PY_VERSION_HEX >= 0x030700A3
25511  tmp_type = tstate->exc_state.exc_type;
25512  tmp_value = tstate->exc_state.exc_value;
25513  tmp_tb = tstate->exc_state.exc_traceback;
25514  tstate->exc_state.exc_type = *type;
25515  tstate->exc_state.exc_value = *value;
25516  tstate->exc_state.exc_traceback = *tb;
25517  #else
25518  tmp_type = tstate->exc_type;
25519  tmp_value = tstate->exc_value;
25520  tmp_tb = tstate->exc_traceback;
25521  tstate->exc_type = *type;
25522  tstate->exc_value = *value;
25523  tstate->exc_traceback = *tb;
25524  #endif
25525  *type = tmp_type;
25526  *value = tmp_value;
25527  *tb = tmp_tb;
25528 }
25529 #else
25530 static CYTHON_INLINE void __Pyx_ExceptionSwap(PyObject **type, PyObject **value, PyObject **tb) {
25531  PyObject *tmp_type, *tmp_value, *tmp_tb;
25532  PyErr_GetExcInfo(&tmp_type, &tmp_value, &tmp_tb);
25533  PyErr_SetExcInfo(*type, *value, *tb);
25534  *type = tmp_type;
25535  *value = tmp_value;
25536  *tb = tmp_tb;
25537 }
25538 #endif
25539 
25540 /* FastTypeChecks */
25541  #if CYTHON_COMPILING_IN_CPYTHON
25542 static int __Pyx_InBases(PyTypeObject *a, PyTypeObject *b) {
25543  while (a) {
25544  a = a->tp_base;
25545  if (a == b)
25546  return 1;
25547  }
25548  return b == &PyBaseObject_Type;
25549 }
25550 static CYTHON_INLINE int __Pyx_IsSubtype(PyTypeObject *a, PyTypeObject *b) {
25551  PyObject *mro;
25552  if (a == b) return 1;
25553  mro = a->tp_mro;
25554  if (likely(mro)) {
25555  Py_ssize_t i, n;
25556  n = PyTuple_GET_SIZE(mro);
25557  for (i = 0; i < n; i++) {
25558  if (PyTuple_GET_ITEM(mro, i) == (PyObject *)b)
25559  return 1;
25560  }
25561  return 0;
25562  }
25563  return __Pyx_InBases(a, b);
25564 }
25565 #if PY_MAJOR_VERSION == 2
25566 static int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject* exc_type2) {
25567  PyObject *exception, *value, *tb;
25568  int res;
25569  __Pyx_PyThreadState_declare
25570  __Pyx_PyThreadState_assign
25571  __Pyx_ErrFetch(&exception, &value, &tb);
25572  res = exc_type1 ? PyObject_IsSubclass(err, exc_type1) : 0;
25573  if (unlikely(res == -1)) {
25574  PyErr_WriteUnraisable(err);
25575  res = 0;
25576  }
25577  if (!res) {
25578  res = PyObject_IsSubclass(err, exc_type2);
25579  if (unlikely(res == -1)) {
25580  PyErr_WriteUnraisable(err);
25581  res = 0;
25582  }
25583  }
25584  __Pyx_ErrRestore(exception, value, tb);
25585  return res;
25586 }
25587 #else
25588 static CYTHON_INLINE int __Pyx_inner_PyErr_GivenExceptionMatches2(PyObject *err, PyObject* exc_type1, PyObject *exc_type2) {
25589  int res = exc_type1 ? __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type1) : 0;
25590  if (!res) {
25591  res = __Pyx_IsSubtype((PyTypeObject*)err, (PyTypeObject*)exc_type2);
25592  }
25593  return res;
25594 }
25595 #endif
25596 static int __Pyx_PyErr_GivenExceptionMatchesTuple(PyObject *exc_type, PyObject *tuple) {
25597  Py_ssize_t i, n;
25598  assert(PyExceptionClass_Check(exc_type));
25599  n = PyTuple_GET_SIZE(tuple);
25600 #if PY_MAJOR_VERSION >= 3
25601  for (i=0; i<n; i++) {
25602  if (exc_type == PyTuple_GET_ITEM(tuple, i)) return 1;
25603  }
25604 #endif
25605  for (i=0; i<n; i++) {
25606  PyObject *t = PyTuple_GET_ITEM(tuple, i);
25607  #if PY_MAJOR_VERSION < 3
25608  if (likely(exc_type == t)) return 1;
25609  #endif
25610  if (likely(PyExceptionClass_Check(t))) {
25611  if (__Pyx_inner_PyErr_GivenExceptionMatches2(exc_type, NULL, t)) return 1;
25612  } else {
25613  }
25614  }
25615  return 0;
25616 }
25617 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches(PyObject *err, PyObject* exc_type) {
25618  if (likely(err == exc_type)) return 1;
25619  if (likely(PyExceptionClass_Check(err))) {
25620  if (likely(PyExceptionClass_Check(exc_type))) {
25621  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, NULL, exc_type);
25622  } else if (likely(PyTuple_Check(exc_type))) {
25623  return __Pyx_PyErr_GivenExceptionMatchesTuple(err, exc_type);
25624  } else {
25625  }
25626  }
25627  return PyErr_GivenExceptionMatches(err, exc_type);
25628 }
25629 static CYTHON_INLINE int __Pyx_PyErr_GivenExceptionMatches2(PyObject *err, PyObject *exc_type1, PyObject *exc_type2) {
25630  assert(PyExceptionClass_Check(exc_type1));
25631  assert(PyExceptionClass_Check(exc_type2));
25632  if (likely(err == exc_type1 || err == exc_type2)) return 1;
25633  if (likely(PyExceptionClass_Check(err))) {
25634  return __Pyx_inner_PyErr_GivenExceptionMatches2(err, exc_type1, exc_type2);
25635  }
25636  return (PyErr_GivenExceptionMatches(err, exc_type1) || PyErr_GivenExceptionMatches(err, exc_type2));
25637 }
25638 #endif
25639 
25640 /* PyIntBinop */
25641  #if !CYTHON_COMPILING_IN_PYPY
25642 static PyObject* __Pyx_PyInt_AddObjC(PyObject *op1, PyObject *op2, CYTHON_UNUSED long intval, CYTHON_UNUSED int inplace) {
25643  #if PY_MAJOR_VERSION < 3
25644  if (likely(PyInt_CheckExact(op1))) {
25645  const long b = intval;
25646  long x;
25647  long a = PyInt_AS_LONG(op1);
25648  x = (long)((unsigned long)a + b);
25649  if (likely((x^a) >= 0 || (x^b) >= 0))
25650  return PyInt_FromLong(x);
25651  return PyLong_Type.tp_as_number->nb_add(op1, op2);
25652  }
25653  #endif
25654  #if CYTHON_USE_PYLONG_INTERNALS
25655  if (likely(PyLong_CheckExact(op1))) {
25656  const long b = intval;
25657  long a, x;
25658 #ifdef HAVE_LONG_LONG
25659  const PY_LONG_LONG llb = intval;
25660  PY_LONG_LONG lla, llx;
25661 #endif
25662  const digit* digits = ((PyLongObject*)op1)->ob_digit;
25663  const Py_ssize_t size = Py_SIZE(op1);
25664  if (likely(__Pyx_sst_abs(size) <= 1)) {
25665  a = likely(size) ? digits[0] : 0;
25666  if (size == -1) a = -a;
25667  } else {
25668  switch (size) {
25669  case -2:
25670  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25671  a = -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25672  break;
25673 #ifdef HAVE_LONG_LONG
25674  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25675  lla = -(PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25676  goto long_long;
25677 #endif
25678  }
25679  CYTHON_FALLTHROUGH;
25680  case 2:
25681  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
25682  a = (long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25683  break;
25684 #ifdef HAVE_LONG_LONG
25685  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 2 * PyLong_SHIFT) {
25686  lla = (PY_LONG_LONG) (((((unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25687  goto long_long;
25688 #endif
25689  }
25690  CYTHON_FALLTHROUGH;
25691  case -3:
25692  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25693  a = -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25694  break;
25695 #ifdef HAVE_LONG_LONG
25696  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25697  lla = -(PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25698  goto long_long;
25699 #endif
25700  }
25701  CYTHON_FALLTHROUGH;
25702  case 3:
25703  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
25704  a = (long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25705  break;
25706 #ifdef HAVE_LONG_LONG
25707  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 3 * PyLong_SHIFT) {
25708  lla = (PY_LONG_LONG) (((((((unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25709  goto long_long;
25710 #endif
25711  }
25712  CYTHON_FALLTHROUGH;
25713  case -4:
25714  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25715  a = -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25716  break;
25717 #ifdef HAVE_LONG_LONG
25718  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25719  lla = -(PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25720  goto long_long;
25721 #endif
25722  }
25723  CYTHON_FALLTHROUGH;
25724  case 4:
25725  if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
25726  a = (long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0]));
25727  break;
25728 #ifdef HAVE_LONG_LONG
25729  } else if (8 * sizeof(PY_LONG_LONG) - 1 > 4 * PyLong_SHIFT) {
25730  lla = (PY_LONG_LONG) (((((((((unsigned PY_LONG_LONG)digits[3]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[2]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[1]) << PyLong_SHIFT) | (unsigned PY_LONG_LONG)digits[0]));
25731  goto long_long;
25732 #endif
25733  }
25734  CYTHON_FALLTHROUGH;
25735  default: return PyLong_Type.tp_as_number->nb_add(op1, op2);
25736  }
25737  }
25738  x = a + b;
25739  return PyLong_FromLong(x);
25740 #ifdef HAVE_LONG_LONG
25741  long_long:
25742  llx = lla + llb;
25743  return PyLong_FromLongLong(llx);
25744 #endif
25745 
25746 
25747  }
25748  #endif
25749  if (PyFloat_CheckExact(op1)) {
25750  const long b = intval;
25751  double a = PyFloat_AS_DOUBLE(op1);
25752  double result;
25753  PyFPE_START_PROTECT("add", return NULL)
25754  result = ((double)a) + (double)b;
25755  PyFPE_END_PROTECT(result)
25756  return PyFloat_FromDouble(result);
25757  }
25758  return (inplace ? PyNumber_InPlaceAdd : PyNumber_Add)(op1, op2);
25759 }
25760 #endif
25761 
25762 /* None */
25763  static CYTHON_INLINE void __Pyx_RaiseUnboundLocalError(const char *varname) {
25764  PyErr_Format(PyExc_UnboundLocalError, "local variable '%s' referenced before assignment", varname);
25765 }
25766 
25767 /* None */
25768  static CYTHON_INLINE long __Pyx_div_long(long a, long b) {
25769  long q = a / b;
25770  long r = a - q*b;
25771  q -= ((r != 0) & ((r ^ b) < 0));
25772  return q;
25773 }
25774 
25775 /* PyObject_GenericGetAttrNoDict */
25776  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25777 static PyObject *__Pyx_RaiseGenericGetAttributeError(PyTypeObject *tp, PyObject *attr_name) {
25778  PyErr_Format(PyExc_AttributeError,
25779 #if PY_MAJOR_VERSION >= 3
25780  "'%.50s' object has no attribute '%U'",
25781  tp->tp_name, attr_name);
25782 #else
25783  "'%.50s' object has no attribute '%.400s'",
25784  tp->tp_name, PyString_AS_STRING(attr_name));
25785 #endif
25786  return NULL;
25787 }
25788 static CYTHON_INLINE PyObject* __Pyx_PyObject_GenericGetAttrNoDict(PyObject* obj, PyObject* attr_name) {
25789  PyObject *descr;
25790  PyTypeObject *tp = Py_TYPE(obj);
25791  if (unlikely(!PyString_Check(attr_name))) {
25792  return PyObject_GenericGetAttr(obj, attr_name);
25793  }
25794  assert(!tp->tp_dictoffset);
25795  descr = _PyType_Lookup(tp, attr_name);
25796  if (unlikely(!descr)) {
25797  return __Pyx_RaiseGenericGetAttributeError(tp, attr_name);
25798  }
25799  Py_INCREF(descr);
25800  #if PY_MAJOR_VERSION < 3
25801  if (likely(PyType_HasFeature(Py_TYPE(descr), Py_TPFLAGS_HAVE_CLASS)))
25802  #endif
25803  {
25804  descrgetfunc f = Py_TYPE(descr)->tp_descr_get;
25805  if (unlikely(f)) {
25806  PyObject *res = f(descr, obj, (PyObject *)tp);
25807  Py_DECREF(descr);
25808  return res;
25809  }
25810  }
25811  return descr;
25812 }
25813 #endif
25814 
25815 /* PyObject_GenericGetAttr */
25816  #if CYTHON_USE_TYPE_SLOTS && CYTHON_USE_PYTYPE_LOOKUP && PY_VERSION_HEX < 0x03070000
25817 static PyObject* __Pyx_PyObject_GenericGetAttr(PyObject* obj, PyObject* attr_name) {
25818  if (unlikely(Py_TYPE(obj)->tp_dictoffset)) {
25819  return PyObject_GenericGetAttr(obj, attr_name);
25820  }
25821  return __Pyx_PyObject_GenericGetAttrNoDict(obj, attr_name);
25822 }
25823 #endif
25824 
25825 /* SetupReduce */
25826  static int __Pyx_setup_reduce_is_named(PyObject* meth, PyObject* name) {
25827  int ret;
25828  PyObject *name_attr;
25829  name_attr = __Pyx_PyObject_GetAttrStr(meth, __pyx_n_s_name_2);
25830  if (likely(name_attr)) {
25831  ret = PyObject_RichCompareBool(name_attr, name, Py_EQ);
25832  } else {
25833  ret = -1;
25834  }
25835  if (unlikely(ret < 0)) {
25836  PyErr_Clear();
25837  ret = 0;
25838  }
25839  Py_XDECREF(name_attr);
25840  return ret;
25841 }
25842 static int __Pyx_setup_reduce(PyObject* type_obj) {
25843  int ret = 0;
25844  PyObject *object_reduce = NULL;
25845  PyObject *object_reduce_ex = NULL;
25846  PyObject *reduce = NULL;
25847  PyObject *reduce_ex = NULL;
25848  PyObject *reduce_cython = NULL;
25849  PyObject *setstate = NULL;
25850  PyObject *setstate_cython = NULL;
25851 #if CYTHON_USE_PYTYPE_LOOKUP
25852  if (_PyType_Lookup((PyTypeObject*)type_obj, __pyx_n_s_getstate)) goto GOOD;
25853 #else
25854  if (PyObject_HasAttr(type_obj, __pyx_n_s_getstate)) goto GOOD;
25855 #endif
25856 #if CYTHON_USE_PYTYPE_LOOKUP
25857  object_reduce_ex = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
25858 #else
25859  object_reduce_ex = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce_ex); if (!object_reduce_ex) goto BAD;
25860 #endif
25861  reduce_ex = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_ex); if (unlikely(!reduce_ex)) goto BAD;
25862  if (reduce_ex == object_reduce_ex) {
25863 #if CYTHON_USE_PYTYPE_LOOKUP
25864  object_reduce = _PyType_Lookup(&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
25865 #else
25866  object_reduce = __Pyx_PyObject_GetAttrStr((PyObject*)&PyBaseObject_Type, __pyx_n_s_reduce); if (!object_reduce) goto BAD;
25867 #endif
25868  reduce = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce); if (unlikely(!reduce)) goto BAD;
25869  if (reduce == object_reduce || __Pyx_setup_reduce_is_named(reduce, __pyx_n_s_reduce_cython)) {
25870  reduce_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_reduce_cython); if (unlikely(!reduce_cython)) goto BAD;
25871  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce, reduce_cython); if (unlikely(ret < 0)) goto BAD;
25872  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_reduce_cython); if (unlikely(ret < 0)) goto BAD;
25873  setstate = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate);
25874  if (!setstate) PyErr_Clear();
25875  if (!setstate || __Pyx_setup_reduce_is_named(setstate, __pyx_n_s_setstate_cython)) {
25876  setstate_cython = __Pyx_PyObject_GetAttrStr(type_obj, __pyx_n_s_setstate_cython); if (unlikely(!setstate_cython)) goto BAD;
25877  ret = PyDict_SetItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate, setstate_cython); if (unlikely(ret < 0)) goto BAD;
25878  ret = PyDict_DelItem(((PyTypeObject*)type_obj)->tp_dict, __pyx_n_s_setstate_cython); if (unlikely(ret < 0)) goto BAD;
25879  }
25880  PyType_Modified((PyTypeObject*)type_obj);
25881  }
25882  }
25883  goto GOOD;
25884 BAD:
25885  if (!PyErr_Occurred())
25886  PyErr_Format(PyExc_RuntimeError, "Unable to initialize pickling for %s", ((PyTypeObject*)type_obj)->tp_name);
25887  ret = -1;
25888 GOOD:
25889 #if !CYTHON_USE_PYTYPE_LOOKUP
25890  Py_XDECREF(object_reduce);
25891  Py_XDECREF(object_reduce_ex);
25892 #endif
25893  Py_XDECREF(reduce);
25894  Py_XDECREF(reduce_ex);
25895  Py_XDECREF(reduce_cython);
25896  Py_XDECREF(setstate);
25897  Py_XDECREF(setstate_cython);
25898  return ret;
25899 }
25900 
25901 /* SetVTable */
25902  static int __Pyx_SetVtable(PyObject *dict, void *vtable) {
25903 #if PY_VERSION_HEX >= 0x02070000
25904  PyObject *ob = PyCapsule_New(vtable, 0, 0);
25905 #else
25906  PyObject *ob = PyCObject_FromVoidPtr(vtable, 0);
25907 #endif
25908  if (!ob)
25909  goto bad;
25910  if (PyDict_SetItem(dict, __pyx_n_s_pyx_vtable, ob) < 0)
25911  goto bad;
25912  Py_DECREF(ob);
25913  return 0;
25914 bad:
25915  Py_XDECREF(ob);
25916  return -1;
25917 }
25918 
25919 /* CLineInTraceback */
25920  #ifndef CYTHON_CLINE_IN_TRACEBACK
25921 static int __Pyx_CLineForTraceback(CYTHON_UNUSED PyThreadState *tstate, int c_line) {
25922  PyObject *use_cline;
25923  PyObject *ptype, *pvalue, *ptraceback;
25924 #if CYTHON_COMPILING_IN_CPYTHON
25925  PyObject **cython_runtime_dict;
25926 #endif
25927  if (unlikely(!__pyx_cython_runtime)) {
25928  return c_line;
25929  }
25930  __Pyx_ErrFetchInState(tstate, &ptype, &pvalue, &ptraceback);
25931 #if CYTHON_COMPILING_IN_CPYTHON
25932  cython_runtime_dict = _PyObject_GetDictPtr(__pyx_cython_runtime);
25933  if (likely(cython_runtime_dict)) {
25934  use_cline = __Pyx_PyDict_GetItemStr(*cython_runtime_dict, __pyx_n_s_cline_in_traceback);
25935  } else
25936 #endif
25937  {
25938  PyObject *use_cline_obj = __Pyx_PyObject_GetAttrStr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback);
25939  if (use_cline_obj) {
25940  use_cline = PyObject_Not(use_cline_obj) ? Py_False : Py_True;
25941  Py_DECREF(use_cline_obj);
25942  } else {
25943  PyErr_Clear();
25944  use_cline = NULL;
25945  }
25946  }
25947  if (!use_cline) {
25948  c_line = 0;
25949  PyObject_SetAttr(__pyx_cython_runtime, __pyx_n_s_cline_in_traceback, Py_False);
25950  }
25951  else if (PyObject_Not(use_cline) != 0) {
25952  c_line = 0;
25953  }
25954  __Pyx_ErrRestoreInState(tstate, ptype, pvalue, ptraceback);
25955  return c_line;
25956 }
25957 #endif
25958 
25959 /* CodeObjectCache */
25960  static int __pyx_bisect_code_objects(__Pyx_CodeObjectCacheEntry* entries, int count, int code_line) {
25961  int start = 0, mid = 0, end = count - 1;
25962  if (end >= 0 && code_line > entries[end].code_line) {
25963  return count;
25964  }
25965  while (start < end) {
25966  mid = start + (end - start) / 2;
25967  if (code_line < entries[mid].code_line) {
25968  end = mid;
25969  } else if (code_line > entries[mid].code_line) {
25970  start = mid + 1;
25971  } else {
25972  return mid;
25973  }
25974  }
25975  if (code_line <= entries[mid].code_line) {
25976  return mid;
25977  } else {
25978  return mid + 1;
25979  }
25980 }
25981 static PyCodeObject *__pyx_find_code_object(int code_line) {
25982  PyCodeObject* code_object;
25983  int pos;
25984  if (unlikely(!code_line) || unlikely(!__pyx_code_cache.entries)) {
25985  return NULL;
25986  }
25987  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
25988  if (unlikely(pos >= __pyx_code_cache.count) || unlikely(__pyx_code_cache.entries[pos].code_line != code_line)) {
25989  return NULL;
25990  }
25991  code_object = __pyx_code_cache.entries[pos].code_object;
25992  Py_INCREF(code_object);
25993  return code_object;
25994 }
25995 static void __pyx_insert_code_object(int code_line, PyCodeObject* code_object) {
25996  int pos, i;
25997  __Pyx_CodeObjectCacheEntry* entries = __pyx_code_cache.entries;
25998  if (unlikely(!code_line)) {
25999  return;
26000  }
26001  if (unlikely(!entries)) {
26002  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Malloc(64*sizeof(__Pyx_CodeObjectCacheEntry));
26003  if (likely(entries)) {
26004  __pyx_code_cache.entries = entries;
26005  __pyx_code_cache.max_count = 64;
26006  __pyx_code_cache.count = 1;
26007  entries[0].code_line = code_line;
26008  entries[0].code_object = code_object;
26009  Py_INCREF(code_object);
26010  }
26011  return;
26012  }
26013  pos = __pyx_bisect_code_objects(__pyx_code_cache.entries, __pyx_code_cache.count, code_line);
26014  if ((pos < __pyx_code_cache.count) && unlikely(__pyx_code_cache.entries[pos].code_line == code_line)) {
26015  PyCodeObject* tmp = entries[pos].code_object;
26016  entries[pos].code_object = code_object;
26017  Py_DECREF(tmp);
26018  return;
26019  }
26020  if (__pyx_code_cache.count == __pyx_code_cache.max_count) {
26021  int new_max = __pyx_code_cache.max_count + 64;
26022  entries = (__Pyx_CodeObjectCacheEntry*)PyMem_Realloc(
26023  __pyx_code_cache.entries, (size_t)new_max*sizeof(__Pyx_CodeObjectCacheEntry));
26024  if (unlikely(!entries)) {
26025  return;
26026  }
26027  __pyx_code_cache.entries = entries;
26028  __pyx_code_cache.max_count = new_max;
26029  }
26030  for (i=__pyx_code_cache.count; i>pos; i--) {
26031  entries[i] = entries[i-1];
26032  }
26033  entries[pos].code_line = code_line;
26034  entries[pos].code_object = code_object;
26035  __pyx_code_cache.count++;
26036  Py_INCREF(code_object);
26037 }
26038 
26039 /* AddTraceback */
26040  #include "compile.h"
26041 #include "frameobject.h"
26042 #include "traceback.h"
26043 static PyCodeObject* __Pyx_CreateCodeObjectForTraceback(
26044  const char *funcname, int c_line,
26045  int py_line, const char *filename) {
26046  PyCodeObject *py_code = 0;
26047  PyObject *py_srcfile = 0;
26048  PyObject *py_funcname = 0;
26049  #if PY_MAJOR_VERSION < 3
26050  py_srcfile = PyString_FromString(filename);
26051  #else
26052  py_srcfile = PyUnicode_FromString(filename);
26053  #endif
26054  if (!py_srcfile) goto bad;
26055  if (c_line) {
26056  #if PY_MAJOR_VERSION < 3
26057  py_funcname = PyString_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26058  #else
26059  py_funcname = PyUnicode_FromFormat( "%s (%s:%d)", funcname, __pyx_cfilenm, c_line);
26060  #endif
26061  }
26062  else {
26063  #if PY_MAJOR_VERSION < 3
26064  py_funcname = PyString_FromString(funcname);
26065  #else
26066  py_funcname = PyUnicode_FromString(funcname);
26067  #endif
26068  }
26069  if (!py_funcname) goto bad;
26070  py_code = __Pyx_PyCode_New(
26071  0,
26072  0,
26073  0,
26074  0,
26075  0,
26076  __pyx_empty_bytes, /*PyObject *code,*/
26077  __pyx_empty_tuple, /*PyObject *consts,*/
26078  __pyx_empty_tuple, /*PyObject *names,*/
26079  __pyx_empty_tuple, /*PyObject *varnames,*/
26080  __pyx_empty_tuple, /*PyObject *freevars,*/
26081  __pyx_empty_tuple, /*PyObject *cellvars,*/
26082  py_srcfile, /*PyObject *filename,*/
26083  py_funcname, /*PyObject *name,*/
26084  py_line,
26085  __pyx_empty_bytes /*PyObject *lnotab*/
26086  );
26087  Py_DECREF(py_srcfile);
26088  Py_DECREF(py_funcname);
26089  return py_code;
26090 bad:
26091  Py_XDECREF(py_srcfile);
26092  Py_XDECREF(py_funcname);
26093  return NULL;
26094 }
26095 static void __Pyx_AddTraceback(const char *funcname, int c_line,
26096  int py_line, const char *filename) {
26097  PyCodeObject *py_code = 0;
26098  PyFrameObject *py_frame = 0;
26099  PyThreadState *tstate = __Pyx_PyThreadState_Current;
26100  if (c_line) {
26101  c_line = __Pyx_CLineForTraceback(tstate, c_line);
26102  }
26103  py_code = __pyx_find_code_object(c_line ? -c_line : py_line);
26104  if (!py_code) {
26105  py_code = __Pyx_CreateCodeObjectForTraceback(
26106  funcname, c_line, py_line, filename);
26107  if (!py_code) goto bad;
26108  __pyx_insert_code_object(c_line ? -c_line : py_line, py_code);
26109  }
26110  py_frame = PyFrame_New(
26111  tstate, /*PyThreadState *tstate,*/
26112  py_code, /*PyCodeObject *code,*/
26113  __pyx_d, /*PyObject *globals,*/
26114  0 /*PyObject *locals*/
26115  );
26116  if (!py_frame) goto bad;
26117  __Pyx_PyFrame_SetLineNumber(py_frame, py_line);
26118  PyTraceBack_Here(py_frame);
26119 bad:
26120  Py_XDECREF(py_code);
26121  Py_XDECREF(py_frame);
26122 }
26123 
26124 #if PY_MAJOR_VERSION < 3
26125 static int __Pyx_GetBuffer(PyObject *obj, Py_buffer *view, int flags) {
26126  if (PyObject_CheckBuffer(obj)) return PyObject_GetBuffer(obj, view, flags);
26127  if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) return __pyx_pw_5numpy_7ndarray_1__getbuffer__(obj, view, flags);
26128  if (__Pyx_TypeCheck(obj, __pyx_array_type)) return __pyx_array_getbuffer(obj, view, flags);
26129  if (__Pyx_TypeCheck(obj, __pyx_memoryview_type)) return __pyx_memoryview_getbuffer(obj, view, flags);
26130  PyErr_Format(PyExc_TypeError, "'%.200s' does not have the buffer interface", Py_TYPE(obj)->tp_name);
26131  return -1;
26132 }
26133 static void __Pyx_ReleaseBuffer(Py_buffer *view) {
26134  PyObject *obj = view->obj;
26135  if (!obj) return;
26136  if (PyObject_CheckBuffer(obj)) {
26137  PyBuffer_Release(view);
26138  return;
26139  }
26140  if ((0)) {}
26141  else if (__Pyx_TypeCheck(obj, __pyx_ptype_5numpy_ndarray)) __pyx_pw_5numpy_7ndarray_3__releasebuffer__(obj, view);
26142  view->obj = NULL;
26143  Py_DECREF(obj);
26144 }
26145 #endif
26146 
26147 
26148  /* MemviewSliceIsContig */
26149  static int
26150 __pyx_memviewslice_is_contig(const __Pyx_memviewslice mvs, char order, int ndim)
26151 {
26152  int i, index, step, start;
26153  Py_ssize_t itemsize = mvs.memview->view.itemsize;
26154  if (order == 'F') {
26155  step = 1;
26156  start = 0;
26157  } else {
26158  step = -1;
26159  start = ndim - 1;
26160  }
26161  for (i = 0; i < ndim; i++) {
26162  index = start + step * i;
26163  if (mvs.suboffsets[index] >= 0 || mvs.strides[index] != itemsize)
26164  return 0;
26165  itemsize *= mvs.shape[index];
26166  }
26167  return 1;
26168 }
26169 
26170 /* OverlappingSlices */
26171  static void
26172 __pyx_get_array_memory_extents(__Pyx_memviewslice *slice,
26173  void **out_start, void **out_end,
26174  int ndim, size_t itemsize)
26175 {
26176  char *start, *end;
26177  int i;
26178  start = end = slice->data;
26179  for (i = 0; i < ndim; i++) {
26180  Py_ssize_t stride = slice->strides[i];
26181  Py_ssize_t extent = slice->shape[i];
26182  if (extent == 0) {
26183  *out_start = *out_end = start;
26184  return;
26185  } else {
26186  if (stride > 0)
26187  end += stride * (extent - 1);
26188  else
26189  start += stride * (extent - 1);
26190  }
26191  }
26192  *out_start = start;
26193  *out_end = end + itemsize;
26194 }
26195 static int
26196 __pyx_slices_overlap(__Pyx_memviewslice *slice1,
26197  __Pyx_memviewslice *slice2,
26198  int ndim, size_t itemsize)
26199 {
26200  void *start1, *end1, *start2, *end2;
26201  __pyx_get_array_memory_extents(slice1, &start1, &end1, ndim, itemsize);
26202  __pyx_get_array_memory_extents(slice2, &start2, &end2, ndim, itemsize);
26203  return (start1 < end2) && (start2 < end1);
26204 }
26205 
26206 /* Capsule */
26207  static CYTHON_INLINE PyObject *
26208 __pyx_capsule_create(void *p, CYTHON_UNUSED const char *sig)
26209 {
26210  PyObject *cobj;
26211 #if PY_VERSION_HEX >= 0x02070000
26212  cobj = PyCapsule_New(p, sig, NULL);
26213 #else
26214  cobj = PyCObject_FromVoidPtr(p, NULL);
26215 #endif
26216  return cobj;
26217 }
26218 
26219 /* MemviewDtypeToObject */
26220  static CYTHON_INLINE PyObject *__pyx_memview_get_double(const char *itemp) {
26221  return (PyObject *) PyFloat_FromDouble(*(double *) itemp);
26222 }
26223 static CYTHON_INLINE int __pyx_memview_set_double(const char *itemp, PyObject *obj) {
26224  double value = __pyx_PyFloat_AsDouble(obj);
26225  if ((value == (double)-1) && PyErr_Occurred())
26226  return 0;
26227  *(double *) itemp = value;
26228  return 1;
26229 }
26230 
26231 /* IsLittleEndian */
26232  static CYTHON_INLINE int __Pyx_Is_Little_Endian(void)
26233 {
26234  union {
26235  uint32_t u32;
26236  uint8_t u8[4];
26237  } S;
26238  S.u32 = 0x01020304;
26239  return S.u8[0] == 4;
26240 }
26241 
26242 /* BufferFormatCheck */
26243  static void __Pyx_BufFmt_Init(__Pyx_BufFmt_Context* ctx,
26244  __Pyx_BufFmt_StackElem* stack,
26245  __Pyx_TypeInfo* type) {
26246  stack[0].field = &ctx->root;
26247  stack[0].parent_offset = 0;
26248  ctx->root.type = type;
26249  ctx->root.name = "buffer dtype";
26250  ctx->root.offset = 0;
26251  ctx->head = stack;
26252  ctx->head->field = &ctx->root;
26253  ctx->fmt_offset = 0;
26254  ctx->head->parent_offset = 0;
26255  ctx->new_packmode = '@';
26256  ctx->enc_packmode = '@';
26257  ctx->new_count = 1;
26258  ctx->enc_count = 0;
26259  ctx->enc_type = 0;
26260  ctx->is_complex = 0;
26261  ctx->is_valid_array = 0;
26262  ctx->struct_alignment = 0;
26263  while (type->typegroup == 'S') {
26264  ++ctx->head;
26265  ctx->head->field = type->fields;
26266  ctx->head->parent_offset = 0;
26267  type = type->fields->type;
26268  }
26269 }
26270 static int __Pyx_BufFmt_ParseNumber(const char** ts) {
26271  int count;
26272  const char* t = *ts;
26273  if (*t < '0' || *t > '9') {
26274  return -1;
26275  } else {
26276  count = *t++ - '0';
26277  while (*t >= '0' && *t < '9') {
26278  count *= 10;
26279  count += *t++ - '0';
26280  }
26281  }
26282  *ts = t;
26283  return count;
26284 }
26285 static int __Pyx_BufFmt_ExpectNumber(const char **ts) {
26286  int number = __Pyx_BufFmt_ParseNumber(ts);
26287  if (number == -1)
26288  PyErr_Format(PyExc_ValueError,\
26289  "Does not understand character buffer dtype format string ('%c')", **ts);
26290  return number;
26291 }
26292 static void __Pyx_BufFmt_RaiseUnexpectedChar(char ch) {
26293  PyErr_Format(PyExc_ValueError,
26294  "Unexpected format string character: '%c'", ch);
26295 }
26296 static const char* __Pyx_BufFmt_DescribeTypeChar(char ch, int is_complex) {
26297  switch (ch) {
26298  case 'c': return "'char'";
26299  case 'b': return "'signed char'";
26300  case 'B': return "'unsigned char'";
26301  case 'h': return "'short'";
26302  case 'H': return "'unsigned short'";
26303  case 'i': return "'int'";
26304  case 'I': return "'unsigned int'";
26305  case 'l': return "'long'";
26306  case 'L': return "'unsigned long'";
26307  case 'q': return "'long long'";
26308  case 'Q': return "'unsigned long long'";
26309  case 'f': return (is_complex ? "'complex float'" : "'float'");
26310  case 'd': return (is_complex ? "'complex double'" : "'double'");
26311  case 'g': return (is_complex ? "'complex long double'" : "'long double'");
26312  case 'T': return "a struct";
26313  case 'O': return "Python object";
26314  case 'P': return "a pointer";
26315  case 's': case 'p': return "a string";
26316  case 0: return "end";
26317  default: return "unparseable format string";
26318  }
26319 }
26320 static size_t __Pyx_BufFmt_TypeCharToStandardSize(char ch, int is_complex) {
26321  switch (ch) {
26322  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26323  case 'h': case 'H': return 2;
26324  case 'i': case 'I': case 'l': case 'L': return 4;
26325  case 'q': case 'Q': return 8;
26326  case 'f': return (is_complex ? 8 : 4);
26327  case 'd': return (is_complex ? 16 : 8);
26328  case 'g': {
26329  PyErr_SetString(PyExc_ValueError, "Python does not define a standard format string size for long double ('g')..");
26330  return 0;
26331  }
26332  case 'O': case 'P': return sizeof(void*);
26333  default:
26334  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26335  return 0;
26336  }
26337 }
26338 static size_t __Pyx_BufFmt_TypeCharToNativeSize(char ch, int is_complex) {
26339  switch (ch) {
26340  case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26341  case 'h': case 'H': return sizeof(short);
26342  case 'i': case 'I': return sizeof(int);
26343  case 'l': case 'L': return sizeof(long);
26344  #ifdef HAVE_LONG_LONG
26345  case 'q': case 'Q': return sizeof(PY_LONG_LONG);
26346  #endif
26347  case 'f': return sizeof(float) * (is_complex ? 2 : 1);
26348  case 'd': return sizeof(double) * (is_complex ? 2 : 1);
26349  case 'g': return sizeof(long double) * (is_complex ? 2 : 1);
26350  case 'O': case 'P': return sizeof(void*);
26351  default: {
26352  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26353  return 0;
26354  }
26355  }
26356 }
26357 typedef struct { char c; short x; } __Pyx_st_short;
26358 typedef struct { char c; int x; } __Pyx_st_int;
26359 typedef struct { char c; long x; } __Pyx_st_long;
26360 typedef struct { char c; float x; } __Pyx_st_float;
26361 typedef struct { char c; double x; } __Pyx_st_double;
26362 typedef struct { char c; long double x; } __Pyx_st_longdouble;
26363 typedef struct { char c; void *x; } __Pyx_st_void_p;
26364 #ifdef HAVE_LONG_LONG
26365 typedef struct { char c; PY_LONG_LONG x; } __Pyx_st_longlong;
26366 #endif
26367 static size_t __Pyx_BufFmt_TypeCharToAlignment(char ch, CYTHON_UNUSED int is_complex) {
26368  switch (ch) {
26369  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26370  case 'h': case 'H': return sizeof(__Pyx_st_short) - sizeof(short);
26371  case 'i': case 'I': return sizeof(__Pyx_st_int) - sizeof(int);
26372  case 'l': case 'L': return sizeof(__Pyx_st_long) - sizeof(long);
26373 #ifdef HAVE_LONG_LONG
26374  case 'q': case 'Q': return sizeof(__Pyx_st_longlong) - sizeof(PY_LONG_LONG);
26375 #endif
26376  case 'f': return sizeof(__Pyx_st_float) - sizeof(float);
26377  case 'd': return sizeof(__Pyx_st_double) - sizeof(double);
26378  case 'g': return sizeof(__Pyx_st_longdouble) - sizeof(long double);
26379  case 'P': case 'O': return sizeof(__Pyx_st_void_p) - sizeof(void*);
26380  default:
26381  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26382  return 0;
26383  }
26384 }
26385 /* These are for computing the padding at the end of the struct to align
26386  on the first member of the struct. This will probably the same as above,
26387  but we don't have any guarantees.
26388  */
26389 typedef struct { short x; char c; } __Pyx_pad_short;
26390 typedef struct { int x; char c; } __Pyx_pad_int;
26391 typedef struct { long x; char c; } __Pyx_pad_long;
26392 typedef struct { float x; char c; } __Pyx_pad_float;
26393 typedef struct { double x; char c; } __Pyx_pad_double;
26394 typedef struct { long double x; char c; } __Pyx_pad_longdouble;
26395 typedef struct { void *x; char c; } __Pyx_pad_void_p;
26396 #ifdef HAVE_LONG_LONG
26397 typedef struct { PY_LONG_LONG x; char c; } __Pyx_pad_longlong;
26398 #endif
26399 static size_t __Pyx_BufFmt_TypeCharToPadding(char ch, CYTHON_UNUSED int is_complex) {
26400  switch (ch) {
26401  case '?': case 'c': case 'b': case 'B': case 's': case 'p': return 1;
26402  case 'h': case 'H': return sizeof(__Pyx_pad_short) - sizeof(short);
26403  case 'i': case 'I': return sizeof(__Pyx_pad_int) - sizeof(int);
26404  case 'l': case 'L': return sizeof(__Pyx_pad_long) - sizeof(long);
26405 #ifdef HAVE_LONG_LONG
26406  case 'q': case 'Q': return sizeof(__Pyx_pad_longlong) - sizeof(PY_LONG_LONG);
26407 #endif
26408  case 'f': return sizeof(__Pyx_pad_float) - sizeof(float);
26409  case 'd': return sizeof(__Pyx_pad_double) - sizeof(double);
26410  case 'g': return sizeof(__Pyx_pad_longdouble) - sizeof(long double);
26411  case 'P': case 'O': return sizeof(__Pyx_pad_void_p) - sizeof(void*);
26412  default:
26413  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26414  return 0;
26415  }
26416 }
26417 static char __Pyx_BufFmt_TypeCharToGroup(char ch, int is_complex) {
26418  switch (ch) {
26419  case 'c':
26420  return 'H';
26421  case 'b': case 'h': case 'i':
26422  case 'l': case 'q': case 's': case 'p':
26423  return 'I';
26424  case 'B': case 'H': case 'I': case 'L': case 'Q':
26425  return 'U';
26426  case 'f': case 'd': case 'g':
26427  return (is_complex ? 'C' : 'R');
26428  case 'O':
26429  return 'O';
26430  case 'P':
26431  return 'P';
26432  default: {
26433  __Pyx_BufFmt_RaiseUnexpectedChar(ch);
26434  return 0;
26435  }
26436  }
26437 }
26438 static void __Pyx_BufFmt_RaiseExpected(__Pyx_BufFmt_Context* ctx) {
26439  if (ctx->head == NULL || ctx->head->field == &ctx->root) {
26440  const char* expected;
26441  const char* quote;
26442  if (ctx->head == NULL) {
26443  expected = "end";
26444  quote = "";
26445  } else {
26446  expected = ctx->head->field->type->name;
26447  quote = "'";
26448  }
26449  PyErr_Format(PyExc_ValueError,
26450  "Buffer dtype mismatch, expected %s%s%s but got %s",
26451  quote, expected, quote,
26452  __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex));
26453  } else {
26454  __Pyx_StructField* field = ctx->head->field;
26455  __Pyx_StructField* parent = (ctx->head - 1)->field;
26456  PyErr_Format(PyExc_ValueError,
26457  "Buffer dtype mismatch, expected '%s' but got %s in '%s.%s'",
26458  field->type->name, __Pyx_BufFmt_DescribeTypeChar(ctx->enc_type, ctx->is_complex),
26459  parent->type->name, field->name);
26460  }
26461 }
26462 static int __Pyx_BufFmt_ProcessTypeChunk(__Pyx_BufFmt_Context* ctx) {
26463  char group;
26464  size_t size, offset, arraysize = 1;
26465  if (ctx->enc_type == 0) return 0;
26466  if (ctx->head->field->type->arraysize[0]) {
26467  int i, ndim = 0;
26468  if (ctx->enc_type == 's' || ctx->enc_type == 'p') {
26469  ctx->is_valid_array = ctx->head->field->type->ndim == 1;
26470  ndim = 1;
26471  if (ctx->enc_count != ctx->head->field->type->arraysize[0]) {
26472  PyErr_Format(PyExc_ValueError,
26473  "Expected a dimension of size %zu, got %zu",
26474  ctx->head->field->type->arraysize[0], ctx->enc_count);
26475  return -1;
26476  }
26477  }
26478  if (!ctx->is_valid_array) {
26479  PyErr_Format(PyExc_ValueError, "Expected %d dimensions, got %d",
26480  ctx->head->field->type->ndim, ndim);
26481  return -1;
26482  }
26483  for (i = 0; i < ctx->head->field->type->ndim; i++) {
26484  arraysize *= ctx->head->field->type->arraysize[i];
26485  }
26486  ctx->is_valid_array = 0;
26487  ctx->enc_count = 1;
26488  }
26489  group = __Pyx_BufFmt_TypeCharToGroup(ctx->enc_type, ctx->is_complex);
26490  do {
26491  __Pyx_StructField* field = ctx->head->field;
26492  __Pyx_TypeInfo* type = field->type;
26493  if (ctx->enc_packmode == '@' || ctx->enc_packmode == '^') {
26494  size = __Pyx_BufFmt_TypeCharToNativeSize(ctx->enc_type, ctx->is_complex);
26495  } else {
26496  size = __Pyx_BufFmt_TypeCharToStandardSize(ctx->enc_type, ctx->is_complex);
26497  }
26498  if (ctx->enc_packmode == '@') {
26499  size_t align_at = __Pyx_BufFmt_TypeCharToAlignment(ctx->enc_type, ctx->is_complex);
26500  size_t align_mod_offset;
26501  if (align_at == 0) return -1;
26502  align_mod_offset = ctx->fmt_offset % align_at;
26503  if (align_mod_offset > 0) ctx->fmt_offset += align_at - align_mod_offset;
26504  if (ctx->struct_alignment == 0)
26505  ctx->struct_alignment = __Pyx_BufFmt_TypeCharToPadding(ctx->enc_type,
26506  ctx->is_complex);
26507  }
26508  if (type->size != size || type->typegroup != group) {
26509  if (type->typegroup == 'C' && type->fields != NULL) {
26510  size_t parent_offset = ctx->head->parent_offset + field->offset;
26511  ++ctx->head;
26512  ctx->head->field = type->fields;
26513  ctx->head->parent_offset = parent_offset;
26514  continue;
26515  }
26516  if ((type->typegroup == 'H' || group == 'H') && type->size == size) {
26517  } else {
26518  __Pyx_BufFmt_RaiseExpected(ctx);
26519  return -1;
26520  }
26521  }
26522  offset = ctx->head->parent_offset + field->offset;
26523  if (ctx->fmt_offset != offset) {
26524  PyErr_Format(PyExc_ValueError,
26525  "Buffer dtype mismatch; next field is at offset %" CYTHON_FORMAT_SSIZE_T "d but %" CYTHON_FORMAT_SSIZE_T "d expected",
26526  (Py_ssize_t)ctx->fmt_offset, (Py_ssize_t)offset);
26527  return -1;
26528  }
26529  ctx->fmt_offset += size;
26530  if (arraysize)
26531  ctx->fmt_offset += (arraysize - 1) * size;
26532  --ctx->enc_count;
26533  while (1) {
26534  if (field == &ctx->root) {
26535  ctx->head = NULL;
26536  if (ctx->enc_count != 0) {
26537  __Pyx_BufFmt_RaiseExpected(ctx);
26538  return -1;
26539  }
26540  break;
26541  }
26542  ctx->head->field = ++field;
26543  if (field->type == NULL) {
26544  --ctx->head;
26545  field = ctx->head->field;
26546  continue;
26547  } else if (field->type->typegroup == 'S') {
26548  size_t parent_offset = ctx->head->parent_offset + field->offset;
26549  if (field->type->fields->type == NULL) continue;
26550  field = field->type->fields;
26551  ++ctx->head;
26552  ctx->head->field = field;
26553  ctx->head->parent_offset = parent_offset;
26554  break;
26555  } else {
26556  break;
26557  }
26558  }
26559  } while (ctx->enc_count);
26560  ctx->enc_type = 0;
26561  ctx->is_complex = 0;
26562  return 0;
26563 }
26564 static PyObject *
26565 __pyx_buffmt_parse_array(__Pyx_BufFmt_Context* ctx, const char** tsp)
26566 {
26567  const char *ts = *tsp;
26568  int i = 0, number;
26569  int ndim = ctx->head->field->type->ndim;
26570 ;
26571  ++ts;
26572  if (ctx->new_count != 1) {
26573  PyErr_SetString(PyExc_ValueError,
26574  "Cannot handle repeated arrays in format string");
26575  return NULL;
26576  }
26577  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26578  while (*ts && *ts != ')') {
26579  switch (*ts) {
26580  case ' ': case '\f': case '\r': case '\n': case '\t': case '\v': continue;
26581  default: break;
26582  }
26583  number = __Pyx_BufFmt_ExpectNumber(&ts);
26584  if (number == -1) return NULL;
26585  if (i < ndim && (size_t) number != ctx->head->field->type->arraysize[i])
26586  return PyErr_Format(PyExc_ValueError,
26587  "Expected a dimension of size %zu, got %d",
26588  ctx->head->field->type->arraysize[i], number);
26589  if (*ts != ',' && *ts != ')')
26590  return PyErr_Format(PyExc_ValueError,
26591  "Expected a comma in format string, got '%c'", *ts);
26592  if (*ts == ',') ts++;
26593  i++;
26594  }
26595  if (i != ndim)
26596  return PyErr_Format(PyExc_ValueError, "Expected %d dimension(s), got %d",
26597  ctx->head->field->type->ndim, i);
26598  if (!*ts) {
26599  PyErr_SetString(PyExc_ValueError,
26600  "Unexpected end of format string, expected ')'");
26601  return NULL;
26602  }
26603  ctx->is_valid_array = 1;
26604  ctx->new_count = 1;
26605  *tsp = ++ts;
26606  return Py_None;
26607 }
26608 static const char* __Pyx_BufFmt_CheckString(__Pyx_BufFmt_Context* ctx, const char* ts) {
26609  int got_Z = 0;
26610  while (1) {
26611  switch(*ts) {
26612  case 0:
26613  if (ctx->enc_type != 0 && ctx->head == NULL) {
26614  __Pyx_BufFmt_RaiseExpected(ctx);
26615  return NULL;
26616  }
26617  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26618  if (ctx->head != NULL) {
26619  __Pyx_BufFmt_RaiseExpected(ctx);
26620  return NULL;
26621  }
26622  return ts;
26623  case ' ':
26624  case '\r':
26625  case '\n':
26626  ++ts;
26627  break;
26628  case '<':
26629  if (!__Pyx_Is_Little_Endian()) {
26630  PyErr_SetString(PyExc_ValueError, "Little-endian buffer not supported on big-endian compiler");
26631  return NULL;
26632  }
26633  ctx->new_packmode = '=';
26634  ++ts;
26635  break;
26636  case '>':
26637  case '!':
26638  if (__Pyx_Is_Little_Endian()) {
26639  PyErr_SetString(PyExc_ValueError, "Big-endian buffer not supported on little-endian compiler");
26640  return NULL;
26641  }
26642  ctx->new_packmode = '=';
26643  ++ts;
26644  break;
26645  case '=':
26646  case '@':
26647  case '^':
26648  ctx->new_packmode = *ts++;
26649  break;
26650  case 'T':
26651  {
26652  const char* ts_after_sub;
26653  size_t i, struct_count = ctx->new_count;
26654  size_t struct_alignment = ctx->struct_alignment;
26655  ctx->new_count = 1;
26656  ++ts;
26657  if (*ts != '{') {
26658  PyErr_SetString(PyExc_ValueError, "Buffer acquisition: Expected '{' after 'T'");
26659  return NULL;
26660  }
26661  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26662  ctx->enc_type = 0;
26663  ctx->enc_count = 0;
26664  ctx->struct_alignment = 0;
26665  ++ts;
26666  ts_after_sub = ts;
26667  for (i = 0; i != struct_count; ++i) {
26668  ts_after_sub = __Pyx_BufFmt_CheckString(ctx, ts);
26669  if (!ts_after_sub) return NULL;
26670  }
26671  ts = ts_after_sub;
26672  if (struct_alignment) ctx->struct_alignment = struct_alignment;
26673  }
26674  break;
26675  case '}':
26676  {
26677  size_t alignment = ctx->struct_alignment;
26678  ++ts;
26679  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26680  ctx->enc_type = 0;
26681  if (alignment && ctx->fmt_offset % alignment) {
26682  ctx->fmt_offset += alignment - (ctx->fmt_offset % alignment);
26683  }
26684  }
26685  return ts;
26686  case 'x':
26687  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26688  ctx->fmt_offset += ctx->new_count;
26689  ctx->new_count = 1;
26690  ctx->enc_count = 0;
26691  ctx->enc_type = 0;
26692  ctx->enc_packmode = ctx->new_packmode;
26693  ++ts;
26694  break;
26695  case 'Z':
26696  got_Z = 1;
26697  ++ts;
26698  if (*ts != 'f' && *ts != 'd' && *ts != 'g') {
26699  __Pyx_BufFmt_RaiseUnexpectedChar('Z');
26700  return NULL;
26701  }
26702  CYTHON_FALLTHROUGH;
26703  case 'c': case 'b': case 'B': case 'h': case 'H': case 'i': case 'I':
26704  case 'l': case 'L': case 'q': case 'Q':
26705  case 'f': case 'd': case 'g':
26706  case 'O': case 'p':
26707  if (ctx->enc_type == *ts && got_Z == ctx->is_complex &&
26708  ctx->enc_packmode == ctx->new_packmode) {
26709  ctx->enc_count += ctx->new_count;
26710  ctx->new_count = 1;
26711  got_Z = 0;
26712  ++ts;
26713  break;
26714  }
26715  CYTHON_FALLTHROUGH;
26716  case 's':
26717  if (__Pyx_BufFmt_ProcessTypeChunk(ctx) == -1) return NULL;
26718  ctx->enc_count = ctx->new_count;
26719  ctx->enc_packmode = ctx->new_packmode;
26720  ctx->enc_type = *ts;
26721  ctx->is_complex = got_Z;
26722  ++ts;
26723  ctx->new_count = 1;
26724  got_Z = 0;
26725  break;
26726  case ':':
26727  ++ts;
26728  while(*ts != ':') ++ts;
26729  ++ts;
26730  break;
26731  case '(':
26732  if (!__pyx_buffmt_parse_array(ctx, &ts)) return NULL;
26733  break;
26734  default:
26735  {
26736  int number = __Pyx_BufFmt_ExpectNumber(&ts);
26737  if (number == -1) return NULL;
26738  ctx->new_count = (size_t)number;
26739  }
26740  }
26741  }
26742 }
26743 
26744 /* TypeInfoCompare */
26745  static int
26746 __pyx_typeinfo_cmp(__Pyx_TypeInfo *a, __Pyx_TypeInfo *b)
26747 {
26748  int i;
26749  if (!a || !b)
26750  return 0;
26751  if (a == b)
26752  return 1;
26753  if (a->size != b->size || a->typegroup != b->typegroup ||
26754  a->is_unsigned != b->is_unsigned || a->ndim != b->ndim) {
26755  if (a->typegroup == 'H' || b->typegroup == 'H') {
26756  return a->size == b->size;
26757  } else {
26758  return 0;
26759  }
26760  }
26761  if (a->ndim) {
26762  for (i = 0; i < a->ndim; i++)
26763  if (a->arraysize[i] != b->arraysize[i])
26764  return 0;
26765  }
26766  if (a->typegroup == 'S') {
26767  if (a->flags != b->flags)
26768  return 0;
26769  if (a->fields || b->fields) {
26770  if (!(a->fields && b->fields))
26771  return 0;
26772  for (i = 0; a->fields[i].type && b->fields[i].type; i++) {
26773  __Pyx_StructField *field_a = a->fields + i;
26774  __Pyx_StructField *field_b = b->fields + i;
26775  if (field_a->offset != field_b->offset ||
26776  !__pyx_typeinfo_cmp(field_a->type, field_b->type))
26777  return 0;
26778  }
26779  return !a->fields[i].type && !b->fields[i].type;
26780  }
26781  }
26782  return 1;
26783 }
26784 
26785 /* MemviewSliceValidateAndInit */
26786  static int
26787 __pyx_check_strides(Py_buffer *buf, int dim, int ndim, int spec)
26788 {
26789  if (buf->shape[dim] <= 1)
26790  return 1;
26791  if (buf->strides) {
26792  if (spec & __Pyx_MEMVIEW_CONTIG) {
26793  if (spec & (__Pyx_MEMVIEW_PTR|__Pyx_MEMVIEW_FULL)) {
26794  if (buf->strides[dim] != sizeof(void *)) {
26795  PyErr_Format(PyExc_ValueError,
26796  "Buffer is not indirectly contiguous "
26797  "in dimension %d.", dim);
26798  goto fail;
26799  }
26800  } else if (buf->strides[dim] != buf->itemsize) {
26801  PyErr_SetString(PyExc_ValueError,
26802  "Buffer and memoryview are not contiguous "
26803  "in the same dimension.");
26804  goto fail;
26805  }
26806  }
26807  if (spec & __Pyx_MEMVIEW_FOLLOW) {
26808  Py_ssize_t stride = buf->strides[dim];
26809  if (stride < 0)
26810  stride = -stride;
26811  if (stride < buf->itemsize) {
26812  PyErr_SetString(PyExc_ValueError,
26813  "Buffer and memoryview are not contiguous "
26814  "in the same dimension.");
26815  goto fail;
26816  }
26817  }
26818  } else {
26819  if (spec & __Pyx_MEMVIEW_CONTIG && dim != ndim - 1) {
26820  PyErr_Format(PyExc_ValueError,
26821  "C-contiguous buffer is not contiguous in "
26822  "dimension %d", dim);
26823  goto fail;
26824  } else if (spec & (__Pyx_MEMVIEW_PTR)) {
26825  PyErr_Format(PyExc_ValueError,
26826  "C-contiguous buffer is not indirect in "
26827  "dimension %d", dim);
26828  goto fail;
26829  } else if (buf->suboffsets) {
26830  PyErr_SetString(PyExc_ValueError,
26831  "Buffer exposes suboffsets but no strides");
26832  goto fail;
26833  }
26834  }
26835  return 1;
26836 fail:
26837  return 0;
26838 }
26839 static int
26840 __pyx_check_suboffsets(Py_buffer *buf, int dim, CYTHON_UNUSED int ndim, int spec)
26841 {
26842  if (spec & __Pyx_MEMVIEW_DIRECT) {
26843  if (buf->suboffsets && buf->suboffsets[dim] >= 0) {
26844  PyErr_Format(PyExc_ValueError,
26845  "Buffer not compatible with direct access "
26846  "in dimension %d.", dim);
26847  goto fail;
26848  }
26849  }
26850  if (spec & __Pyx_MEMVIEW_PTR) {
26851  if (!buf->suboffsets || (buf->suboffsets && buf->suboffsets[dim] < 0)) {
26852  PyErr_Format(PyExc_ValueError,
26853  "Buffer is not indirectly accessible "
26854  "in dimension %d.", dim);
26855  goto fail;
26856  }
26857  }
26858  return 1;
26859 fail:
26860  return 0;
26861 }
26862 static int
26863 __pyx_verify_contig(Py_buffer *buf, int ndim, int c_or_f_flag)
26864 {
26865  int i;
26866  if (c_or_f_flag & __Pyx_IS_F_CONTIG) {
26867  Py_ssize_t stride = 1;
26868  for (i = 0; i < ndim; i++) {
26869  if (stride * buf->itemsize != buf->strides[i] &&
26870  buf->shape[i] > 1)
26871  {
26872  PyErr_SetString(PyExc_ValueError,
26873  "Buffer not fortran contiguous.");
26874  goto fail;
26875  }
26876  stride = stride * buf->shape[i];
26877  }
26878  } else if (c_or_f_flag & __Pyx_IS_C_CONTIG) {
26879  Py_ssize_t stride = 1;
26880  for (i = ndim - 1; i >- 1; i--) {
26881  if (stride * buf->itemsize != buf->strides[i] &&
26882  buf->shape[i] > 1) {
26883  PyErr_SetString(PyExc_ValueError,
26884  "Buffer not C contiguous.");
26885  goto fail;
26886  }
26887  stride = stride * buf->shape[i];
26888  }
26889  }
26890  return 1;
26891 fail:
26892  return 0;
26893 }
26894 static int __Pyx_ValidateAndInit_memviewslice(
26895  int *axes_specs,
26896  int c_or_f_flag,
26897  int buf_flags,
26898  int ndim,
26899  __Pyx_TypeInfo *dtype,
26900  __Pyx_BufFmt_StackElem stack[],
26901  __Pyx_memviewslice *memviewslice,
26902  PyObject *original_obj)
26903 {
26904  struct __pyx_memoryview_obj *memview, *new_memview;
26905  __Pyx_RefNannyDeclarations
26906  Py_buffer *buf;
26907  int i, spec = 0, retval = -1;
26908  __Pyx_BufFmt_Context ctx;
26909  int from_memoryview = __pyx_memoryview_check(original_obj);
26910  __Pyx_RefNannySetupContext("ValidateAndInit_memviewslice", 0);
26911  if (from_memoryview && __pyx_typeinfo_cmp(dtype, ((struct __pyx_memoryview_obj *)
26912  original_obj)->typeinfo)) {
26913  memview = (struct __pyx_memoryview_obj *) original_obj;
26914  new_memview = NULL;
26915  } else {
26916  memview = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
26917  original_obj, buf_flags, 0, dtype);
26918  new_memview = memview;
26919  if (unlikely(!memview))
26920  goto fail;
26921  }
26922  buf = &memview->view;
26923  if (buf->ndim != ndim) {
26924  PyErr_Format(PyExc_ValueError,
26925  "Buffer has wrong number of dimensions (expected %d, got %d)",
26926  ndim, buf->ndim);
26927  goto fail;
26928  }
26929  if (new_memview) {
26930  __Pyx_BufFmt_Init(&ctx, stack, dtype);
26931  if (!__Pyx_BufFmt_CheckString(&ctx, buf->format)) goto fail;
26932  }
26933  if ((unsigned) buf->itemsize != dtype->size) {
26934  PyErr_Format(PyExc_ValueError,
26935  "Item size of buffer (%" CYTHON_FORMAT_SSIZE_T "u byte%s) "
26936  "does not match size of '%s' (%" CYTHON_FORMAT_SSIZE_T "u byte%s)",
26937  buf->itemsize,
26938  (buf->itemsize > 1) ? "s" : "",
26939  dtype->name,
26940  dtype->size,
26941  (dtype->size > 1) ? "s" : "");
26942  goto fail;
26943  }
26944  for (i = 0; i < ndim; i++) {
26945  spec = axes_specs[i];
26946  if (!__pyx_check_strides(buf, i, ndim, spec))
26947  goto fail;
26948  if (!__pyx_check_suboffsets(buf, i, ndim, spec))
26949  goto fail;
26950  }
26951  if (buf->strides && !__pyx_verify_contig(buf, ndim, c_or_f_flag))
26952  goto fail;
26953  if (unlikely(__Pyx_init_memviewslice(memview, ndim, memviewslice,
26954  new_memview != NULL) == -1)) {
26955  goto fail;
26956  }
26957  retval = 0;
26958  goto no_fail;
26959 fail:
26960  Py_XDECREF(new_memview);
26961  retval = -1;
26962 no_fail:
26963  __Pyx_RefNannyFinishContext();
26964  return retval;
26965 }
26966 
26967 /* ObjectToMemviewSlice */
26968  static CYTHON_INLINE __Pyx_memviewslice __Pyx_PyObject_to_MemoryviewSlice_ds_double(PyObject *obj, int writable_flag) {
26969  __Pyx_memviewslice result = { 0, 0, { 0 }, { 0 }, { 0 } };
26970  __Pyx_BufFmt_StackElem stack[1];
26971  int axes_specs[] = { (__Pyx_MEMVIEW_DIRECT | __Pyx_MEMVIEW_STRIDED) };
26972  int retcode;
26973  if (obj == Py_None) {
26974  result.memview = (struct __pyx_memoryview_obj *) Py_None;
26975  return result;
26976  }
26977  retcode = __Pyx_ValidateAndInit_memviewslice(axes_specs, 0,
26978  PyBUF_RECORDS_RO | writable_flag, 1,
26979  &__Pyx_TypeInfo_double, stack,
26980  &result, obj);
26981  if (unlikely(retcode == -1))
26982  goto __pyx_fail;
26983  return result;
26984 __pyx_fail:
26985  result.memview = NULL;
26986  result.data = NULL;
26987  return result;
26988 }
26989 
26990 /* CIntToPy */
26991  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_int(int value) {
26992  const int neg_one = (int) -1, const_zero = (int) 0;
26993  const int is_unsigned = neg_one > const_zero;
26994  if (is_unsigned) {
26995  if (sizeof(int) < sizeof(long)) {
26996  return PyInt_FromLong((long) value);
26997  } else if (sizeof(int) <= sizeof(unsigned long)) {
26998  return PyLong_FromUnsignedLong((unsigned long) value);
26999 #ifdef HAVE_LONG_LONG
27000  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27001  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27002 #endif
27003  }
27004  } else {
27005  if (sizeof(int) <= sizeof(long)) {
27006  return PyInt_FromLong((long) value);
27007 #ifdef HAVE_LONG_LONG
27008  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27009  return PyLong_FromLongLong((PY_LONG_LONG) value);
27010 #endif
27011  }
27012  }
27013  {
27014  int one = 1; int little = (int)*(unsigned char *)&one;
27015  unsigned char *bytes = (unsigned char *)&value;
27016  return _PyLong_FromByteArray(bytes, sizeof(int),
27017  little, !is_unsigned);
27018  }
27019 }
27020 
27021 /* CIntFromPyVerify */
27022  #define __PYX_VERIFY_RETURN_INT(target_type, func_type, func_value)\
27023  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 0)
27024 #define __PYX_VERIFY_RETURN_INT_EXC(target_type, func_type, func_value)\
27025  __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, 1)
27026 #define __PYX__VERIFY_RETURN_INT(target_type, func_type, func_value, exc)\
27027  {\
27028  func_type value = func_value;\
27029  if (sizeof(target_type) < sizeof(func_type)) {\
27030  if (unlikely(value != (func_type) (target_type) value)) {\
27031  func_type zero = 0;\
27032  if (exc && unlikely(value == (func_type)-1 && PyErr_Occurred()))\
27033  return (target_type) -1;\
27034  if (is_unsigned && unlikely(value < zero))\
27035  goto raise_neg_overflow;\
27036  else\
27037  goto raise_overflow;\
27038  }\
27039  }\
27040  return (target_type) value;\
27041  }
27042 
27043 /* CIntToPy */
27044  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_long(long value) {
27045  const long neg_one = (long) -1, const_zero = (long) 0;
27046  const int is_unsigned = neg_one > const_zero;
27047  if (is_unsigned) {
27048  if (sizeof(long) < sizeof(long)) {
27049  return PyInt_FromLong((long) value);
27050  } else if (sizeof(long) <= sizeof(unsigned long)) {
27051  return PyLong_FromUnsignedLong((unsigned long) value);
27052 #ifdef HAVE_LONG_LONG
27053  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27054  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27055 #endif
27056  }
27057  } else {
27058  if (sizeof(long) <= sizeof(long)) {
27059  return PyInt_FromLong((long) value);
27060 #ifdef HAVE_LONG_LONG
27061  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27062  return PyLong_FromLongLong((PY_LONG_LONG) value);
27063 #endif
27064  }
27065  }
27066  {
27067  int one = 1; int little = (int)*(unsigned char *)&one;
27068  unsigned char *bytes = (unsigned char *)&value;
27069  return _PyLong_FromByteArray(bytes, sizeof(long),
27070  little, !is_unsigned);
27071  }
27072 }
27073 
27074 /* Declarations */
27075  #if CYTHON_CCOMPLEX
27076  #ifdef __cplusplus
27077  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27078  return ::std::complex< float >(x, y);
27079  }
27080  #else
27081  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27082  return x + y*(__pyx_t_float_complex)_Complex_I;
27083  }
27084  #endif
27085 #else
27086  static CYTHON_INLINE __pyx_t_float_complex __pyx_t_float_complex_from_parts(float x, float y) {
27087  __pyx_t_float_complex z;
27088  z.real = x;
27089  z.imag = y;
27090  return z;
27091  }
27092 #endif
27093 
27094 /* Arithmetic */
27095  #if CYTHON_CCOMPLEX
27096 #else
27097  static CYTHON_INLINE int __Pyx_c_eq_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27098  return (a.real == b.real) && (a.imag == b.imag);
27099  }
27100  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_sum_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27101  __pyx_t_float_complex z;
27102  z.real = a.real + b.real;
27103  z.imag = a.imag + b.imag;
27104  return z;
27105  }
27106  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_diff_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27107  __pyx_t_float_complex z;
27108  z.real = a.real - b.real;
27109  z.imag = a.imag - b.imag;
27110  return z;
27111  }
27112  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_prod_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27113  __pyx_t_float_complex z;
27114  z.real = a.real * b.real - a.imag * b.imag;
27115  z.imag = a.real * b.imag + a.imag * b.real;
27116  return z;
27117  }
27118  #if 1
27119  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27120  if (b.imag == 0) {
27121  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27122  } else if (fabsf(b.real) >= fabsf(b.imag)) {
27123  if (b.real == 0 && b.imag == 0) {
27124  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.imag);
27125  } else {
27126  float r = b.imag / b.real;
27127  float s = 1.0 / (b.real + b.imag * r);
27128  return __pyx_t_float_complex_from_parts(
27129  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27130  }
27131  } else {
27132  float r = b.real / b.imag;
27133  float s = 1.0 / (b.imag + b.real * r);
27134  return __pyx_t_float_complex_from_parts(
27135  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27136  }
27137  }
27138  #else
27139  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_quot_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27140  if (b.imag == 0) {
27141  return __pyx_t_float_complex_from_parts(a.real / b.real, a.imag / b.real);
27142  } else {
27143  float denom = b.real * b.real + b.imag * b.imag;
27144  return __pyx_t_float_complex_from_parts(
27145  (a.real * b.real + a.imag * b.imag) / denom,
27146  (a.imag * b.real - a.real * b.imag) / denom);
27147  }
27148  }
27149  #endif
27150  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_neg_float(__pyx_t_float_complex a) {
27151  __pyx_t_float_complex z;
27152  z.real = -a.real;
27153  z.imag = -a.imag;
27154  return z;
27155  }
27156  static CYTHON_INLINE int __Pyx_c_is_zero_float(__pyx_t_float_complex a) {
27157  return (a.real == 0) && (a.imag == 0);
27158  }
27159  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_conj_float(__pyx_t_float_complex a) {
27160  __pyx_t_float_complex z;
27161  z.real = a.real;
27162  z.imag = -a.imag;
27163  return z;
27164  }
27165  #if 1
27166  static CYTHON_INLINE float __Pyx_c_abs_float(__pyx_t_float_complex z) {
27167  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27168  return sqrtf(z.real*z.real + z.imag*z.imag);
27169  #else
27170  return hypotf(z.real, z.imag);
27171  #endif
27172  }
27173  static CYTHON_INLINE __pyx_t_float_complex __Pyx_c_pow_float(__pyx_t_float_complex a, __pyx_t_float_complex b) {
27174  __pyx_t_float_complex z;
27175  float r, lnr, theta, z_r, z_theta;
27176  if (b.imag == 0 && b.real == (int)b.real) {
27177  if (b.real < 0) {
27178  float denom = a.real * a.real + a.imag * a.imag;
27179  a.real = a.real / denom;
27180  a.imag = -a.imag / denom;
27181  b.real = -b.real;
27182  }
27183  switch ((int)b.real) {
27184  case 0:
27185  z.real = 1;
27186  z.imag = 0;
27187  return z;
27188  case 1:
27189  return a;
27190  case 2:
27191  z = __Pyx_c_prod_float(a, a);
27192  return __Pyx_c_prod_float(a, a);
27193  case 3:
27194  z = __Pyx_c_prod_float(a, a);
27195  return __Pyx_c_prod_float(z, a);
27196  case 4:
27197  z = __Pyx_c_prod_float(a, a);
27198  return __Pyx_c_prod_float(z, z);
27199  }
27200  }
27201  if (a.imag == 0) {
27202  if (a.real == 0) {
27203  return a;
27204  } else if (b.imag == 0) {
27205  z.real = powf(a.real, b.real);
27206  z.imag = 0;
27207  return z;
27208  } else if (a.real > 0) {
27209  r = a.real;
27210  theta = 0;
27211  } else {
27212  r = -a.real;
27213  theta = atan2f(0, -1);
27214  }
27215  } else {
27216  r = __Pyx_c_abs_float(a);
27217  theta = atan2f(a.imag, a.real);
27218  }
27219  lnr = logf(r);
27220  z_r = expf(lnr * b.real - theta * b.imag);
27221  z_theta = theta * b.real + lnr * b.imag;
27222  z.real = z_r * cosf(z_theta);
27223  z.imag = z_r * sinf(z_theta);
27224  return z;
27225  }
27226  #endif
27227 #endif
27228 
27229 /* Declarations */
27230  #if CYTHON_CCOMPLEX
27231  #ifdef __cplusplus
27232  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27233  return ::std::complex< double >(x, y);
27234  }
27235  #else
27236  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27237  return x + y*(__pyx_t_double_complex)_Complex_I;
27238  }
27239  #endif
27240 #else
27241  static CYTHON_INLINE __pyx_t_double_complex __pyx_t_double_complex_from_parts(double x, double y) {
27242  __pyx_t_double_complex z;
27243  z.real = x;
27244  z.imag = y;
27245  return z;
27246  }
27247 #endif
27248 
27249 /* Arithmetic */
27250  #if CYTHON_CCOMPLEX
27251 #else
27252  static CYTHON_INLINE int __Pyx_c_eq_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27253  return (a.real == b.real) && (a.imag == b.imag);
27254  }
27255  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_sum_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27256  __pyx_t_double_complex z;
27257  z.real = a.real + b.real;
27258  z.imag = a.imag + b.imag;
27259  return z;
27260  }
27261  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_diff_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27262  __pyx_t_double_complex z;
27263  z.real = a.real - b.real;
27264  z.imag = a.imag - b.imag;
27265  return z;
27266  }
27267  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_prod_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27268  __pyx_t_double_complex z;
27269  z.real = a.real * b.real - a.imag * b.imag;
27270  z.imag = a.real * b.imag + a.imag * b.real;
27271  return z;
27272  }
27273  #if 1
27274  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27275  if (b.imag == 0) {
27276  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27277  } else if (fabs(b.real) >= fabs(b.imag)) {
27278  if (b.real == 0 && b.imag == 0) {
27279  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.imag);
27280  } else {
27281  double r = b.imag / b.real;
27282  double s = 1.0 / (b.real + b.imag * r);
27283  return __pyx_t_double_complex_from_parts(
27284  (a.real + a.imag * r) * s, (a.imag - a.real * r) * s);
27285  }
27286  } else {
27287  double r = b.real / b.imag;
27288  double s = 1.0 / (b.imag + b.real * r);
27289  return __pyx_t_double_complex_from_parts(
27290  (a.real * r + a.imag) * s, (a.imag * r - a.real) * s);
27291  }
27292  }
27293  #else
27294  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_quot_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27295  if (b.imag == 0) {
27296  return __pyx_t_double_complex_from_parts(a.real / b.real, a.imag / b.real);
27297  } else {
27298  double denom = b.real * b.real + b.imag * b.imag;
27299  return __pyx_t_double_complex_from_parts(
27300  (a.real * b.real + a.imag * b.imag) / denom,
27301  (a.imag * b.real - a.real * b.imag) / denom);
27302  }
27303  }
27304  #endif
27305  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_neg_double(__pyx_t_double_complex a) {
27306  __pyx_t_double_complex z;
27307  z.real = -a.real;
27308  z.imag = -a.imag;
27309  return z;
27310  }
27311  static CYTHON_INLINE int __Pyx_c_is_zero_double(__pyx_t_double_complex a) {
27312  return (a.real == 0) && (a.imag == 0);
27313  }
27314  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_conj_double(__pyx_t_double_complex a) {
27315  __pyx_t_double_complex z;
27316  z.real = a.real;
27317  z.imag = -a.imag;
27318  return z;
27319  }
27320  #if 1
27321  static CYTHON_INLINE double __Pyx_c_abs_double(__pyx_t_double_complex z) {
27322  #if !defined(HAVE_HYPOT) || defined(_MSC_VER)
27323  return sqrt(z.real*z.real + z.imag*z.imag);
27324  #else
27325  return hypot(z.real, z.imag);
27326  #endif
27327  }
27328  static CYTHON_INLINE __pyx_t_double_complex __Pyx_c_pow_double(__pyx_t_double_complex a, __pyx_t_double_complex b) {
27329  __pyx_t_double_complex z;
27330  double r, lnr, theta, z_r, z_theta;
27331  if (b.imag == 0 && b.real == (int)b.real) {
27332  if (b.real < 0) {
27333  double denom = a.real * a.real + a.imag * a.imag;
27334  a.real = a.real / denom;
27335  a.imag = -a.imag / denom;
27336  b.real = -b.real;
27337  }
27338  switch ((int)b.real) {
27339  case 0:
27340  z.real = 1;
27341  z.imag = 0;
27342  return z;
27343  case 1:
27344  return a;
27345  case 2:
27346  z = __Pyx_c_prod_double(a, a);
27347  return __Pyx_c_prod_double(a, a);
27348  case 3:
27349  z = __Pyx_c_prod_double(a, a);
27350  return __Pyx_c_prod_double(z, a);
27351  case 4:
27352  z = __Pyx_c_prod_double(a, a);
27353  return __Pyx_c_prod_double(z, z);
27354  }
27355  }
27356  if (a.imag == 0) {
27357  if (a.real == 0) {
27358  return a;
27359  } else if (b.imag == 0) {
27360  z.real = pow(a.real, b.real);
27361  z.imag = 0;
27362  return z;
27363  } else if (a.real > 0) {
27364  r = a.real;
27365  theta = 0;
27366  } else {
27367  r = -a.real;
27368  theta = atan2(0, -1);
27369  }
27370  } else {
27371  r = __Pyx_c_abs_double(a);
27372  theta = atan2(a.imag, a.real);
27373  }
27374  lnr = log(r);
27375  z_r = exp(lnr * b.real - theta * b.imag);
27376  z_theta = theta * b.real + lnr * b.imag;
27377  z.real = z_r * cos(z_theta);
27378  z.imag = z_r * sin(z_theta);
27379  return z;
27380  }
27381  #endif
27382 #endif
27383 
27384 /* CIntToPy */
27385  static CYTHON_INLINE PyObject* __Pyx_PyInt_From_enum__NPY_TYPES(enum NPY_TYPES value) {
27386  const enum NPY_TYPES neg_one = (enum NPY_TYPES) -1, const_zero = (enum NPY_TYPES) 0;
27387  const int is_unsigned = neg_one > const_zero;
27388  if (is_unsigned) {
27389  if (sizeof(enum NPY_TYPES) < sizeof(long)) {
27390  return PyInt_FromLong((long) value);
27391  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned long)) {
27392  return PyLong_FromUnsignedLong((unsigned long) value);
27393 #ifdef HAVE_LONG_LONG
27394  } else if (sizeof(enum NPY_TYPES) <= sizeof(unsigned PY_LONG_LONG)) {
27395  return PyLong_FromUnsignedLongLong((unsigned PY_LONG_LONG) value);
27396 #endif
27397  }
27398  } else {
27399  if (sizeof(enum NPY_TYPES) <= sizeof(long)) {
27400  return PyInt_FromLong((long) value);
27401 #ifdef HAVE_LONG_LONG
27402  } else if (sizeof(enum NPY_TYPES) <= sizeof(PY_LONG_LONG)) {
27403  return PyLong_FromLongLong((PY_LONG_LONG) value);
27404 #endif
27405  }
27406  }
27407  {
27408  int one = 1; int little = (int)*(unsigned char *)&one;
27409  unsigned char *bytes = (unsigned char *)&value;
27410  return _PyLong_FromByteArray(bytes, sizeof(enum NPY_TYPES),
27411  little, !is_unsigned);
27412  }
27413 }
27414 
27415 /* MemviewSliceCopyTemplate */
27416  static __Pyx_memviewslice
27417 __pyx_memoryview_copy_new_contig(const __Pyx_memviewslice *from_mvs,
27418  const char *mode, int ndim,
27419  size_t sizeof_dtype, int contig_flag,
27420  int dtype_is_object)
27421 {
27422  __Pyx_RefNannyDeclarations
27423  int i;
27424  __Pyx_memviewslice new_mvs = { 0, 0, { 0 }, { 0 }, { 0 } };
27425  struct __pyx_memoryview_obj *from_memview = from_mvs->memview;
27426  Py_buffer *buf = &from_memview->view;
27427  PyObject *shape_tuple = NULL;
27428  PyObject *temp_int = NULL;
27429  struct __pyx_array_obj *array_obj = NULL;
27430  struct __pyx_memoryview_obj *memview_obj = NULL;
27431  __Pyx_RefNannySetupContext("__pyx_memoryview_copy_new_contig", 0);
27432  for (i = 0; i < ndim; i++) {
27433  if (from_mvs->suboffsets[i] >= 0) {
27434  PyErr_Format(PyExc_ValueError, "Cannot copy memoryview slice with "
27435  "indirect dimensions (axis %d)", i);
27436  goto fail;
27437  }
27438  }
27439  shape_tuple = PyTuple_New(ndim);
27440  if (unlikely(!shape_tuple)) {
27441  goto fail;
27442  }
27443  __Pyx_GOTREF(shape_tuple);
27444  for(i = 0; i < ndim; i++) {
27445  temp_int = PyInt_FromSsize_t(from_mvs->shape[i]);
27446  if(unlikely(!temp_int)) {
27447  goto fail;
27448  } else {
27449  PyTuple_SET_ITEM(shape_tuple, i, temp_int);
27450  temp_int = NULL;
27451  }
27452  }
27453  array_obj = __pyx_array_new(shape_tuple, sizeof_dtype, buf->format, (char *) mode, NULL);
27454  if (unlikely(!array_obj)) {
27455  goto fail;
27456  }
27457  __Pyx_GOTREF(array_obj);
27458  memview_obj = (struct __pyx_memoryview_obj *) __pyx_memoryview_new(
27459  (PyObject *) array_obj, contig_flag,
27460  dtype_is_object,
27461  from_mvs->memview->typeinfo);
27462  if (unlikely(!memview_obj))
27463  goto fail;
27464  if (unlikely(__Pyx_init_memviewslice(memview_obj, ndim, &new_mvs, 1) < 0))
27465  goto fail;
27466  if (unlikely(__pyx_memoryview_copy_contents(*from_mvs, new_mvs, ndim, ndim,
27467  dtype_is_object) < 0))
27468  goto fail;
27469  goto no_fail;
27470 fail:
27471  __Pyx_XDECREF(new_mvs.memview);
27472  new_mvs.memview = NULL;
27473  new_mvs.data = NULL;
27474 no_fail:
27475  __Pyx_XDECREF(shape_tuple);
27476  __Pyx_XDECREF(temp_int);
27477  __Pyx_XDECREF(array_obj);
27478  __Pyx_RefNannyFinishContext();
27479  return new_mvs;
27480 }
27481 
27482 /* CIntFromPy */
27483  static CYTHON_INLINE int __Pyx_PyInt_As_int(PyObject *x) {
27484  const int neg_one = (int) -1, const_zero = (int) 0;
27485  const int is_unsigned = neg_one > const_zero;
27486 #if PY_MAJOR_VERSION < 3
27487  if (likely(PyInt_Check(x))) {
27488  if (sizeof(int) < sizeof(long)) {
27489  __PYX_VERIFY_RETURN_INT(int, long, PyInt_AS_LONG(x))
27490  } else {
27491  long val = PyInt_AS_LONG(x);
27492  if (is_unsigned && unlikely(val < 0)) {
27493  goto raise_neg_overflow;
27494  }
27495  return (int) val;
27496  }
27497  } else
27498 #endif
27499  if (likely(PyLong_Check(x))) {
27500  if (is_unsigned) {
27501 #if CYTHON_USE_PYLONG_INTERNALS
27502  const digit* digits = ((PyLongObject*)x)->ob_digit;
27503  switch (Py_SIZE(x)) {
27504  case 0: return (int) 0;
27505  case 1: __PYX_VERIFY_RETURN_INT(int, digit, digits[0])
27506  case 2:
27507  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27508  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27509  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27510  } else if (8 * sizeof(int) >= 2 * PyLong_SHIFT) {
27511  return (int) (((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27512  }
27513  }
27514  break;
27515  case 3:
27516  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27517  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27518  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27519  } else if (8 * sizeof(int) >= 3 * PyLong_SHIFT) {
27520  return (int) (((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27521  }
27522  }
27523  break;
27524  case 4:
27525  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27526  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27527  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27528  } else if (8 * sizeof(int) >= 4 * PyLong_SHIFT) {
27529  return (int) (((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0]));
27530  }
27531  }
27532  break;
27533  }
27534 #endif
27535 #if CYTHON_COMPILING_IN_CPYTHON
27536  if (unlikely(Py_SIZE(x) < 0)) {
27537  goto raise_neg_overflow;
27538  }
27539 #else
27540  {
27541  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27542  if (unlikely(result < 0))
27543  return (int) -1;
27544  if (unlikely(result == 1))
27545  goto raise_neg_overflow;
27546  }
27547 #endif
27548  if (sizeof(int) <= sizeof(unsigned long)) {
27549  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned long, PyLong_AsUnsignedLong(x))
27550 #ifdef HAVE_LONG_LONG
27551  } else if (sizeof(int) <= sizeof(unsigned PY_LONG_LONG)) {
27552  __PYX_VERIFY_RETURN_INT_EXC(int, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27553 #endif
27554  }
27555  } else {
27556 #if CYTHON_USE_PYLONG_INTERNALS
27557  const digit* digits = ((PyLongObject*)x)->ob_digit;
27558  switch (Py_SIZE(x)) {
27559  case 0: return (int) 0;
27560  case -1: __PYX_VERIFY_RETURN_INT(int, sdigit, (sdigit) (-(sdigit)digits[0]))
27561  case 1: __PYX_VERIFY_RETURN_INT(int, digit, +digits[0])
27562  case -2:
27563  if (8 * sizeof(int) - 1 > 1 * PyLong_SHIFT) {
27564  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27565  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27566  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27567  return (int) (((int)-1)*(((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27568  }
27569  }
27570  break;
27571  case 2:
27572  if (8 * sizeof(int) > 1 * PyLong_SHIFT) {
27573  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27574  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27575  } else if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27576  return (int) ((((((int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27577  }
27578  }
27579  break;
27580  case -3:
27581  if (8 * sizeof(int) - 1 > 2 * PyLong_SHIFT) {
27582  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27583  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27584  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27585  return (int) (((int)-1)*(((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27586  }
27587  }
27588  break;
27589  case 3:
27590  if (8 * sizeof(int) > 2 * PyLong_SHIFT) {
27591  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27592  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27593  } else if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27594  return (int) ((((((((int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27595  }
27596  }
27597  break;
27598  case -4:
27599  if (8 * sizeof(int) - 1 > 3 * PyLong_SHIFT) {
27600  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27601  __PYX_VERIFY_RETURN_INT(int, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27602  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27603  return (int) (((int)-1)*(((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27604  }
27605  }
27606  break;
27607  case 4:
27608  if (8 * sizeof(int) > 3 * PyLong_SHIFT) {
27609  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27610  __PYX_VERIFY_RETURN_INT(int, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27611  } else if (8 * sizeof(int) - 1 > 4 * PyLong_SHIFT) {
27612  return (int) ((((((((((int)digits[3]) << PyLong_SHIFT) | (int)digits[2]) << PyLong_SHIFT) | (int)digits[1]) << PyLong_SHIFT) | (int)digits[0])));
27613  }
27614  }
27615  break;
27616  }
27617 #endif
27618  if (sizeof(int) <= sizeof(long)) {
27619  __PYX_VERIFY_RETURN_INT_EXC(int, long, PyLong_AsLong(x))
27620 #ifdef HAVE_LONG_LONG
27621  } else if (sizeof(int) <= sizeof(PY_LONG_LONG)) {
27622  __PYX_VERIFY_RETURN_INT_EXC(int, PY_LONG_LONG, PyLong_AsLongLong(x))
27623 #endif
27624  }
27625  }
27626  {
27627 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27628  PyErr_SetString(PyExc_RuntimeError,
27629  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27630 #else
27631  int val;
27632  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27633  #if PY_MAJOR_VERSION < 3
27634  if (likely(v) && !PyLong_Check(v)) {
27635  PyObject *tmp = v;
27636  v = PyNumber_Long(tmp);
27637  Py_DECREF(tmp);
27638  }
27639  #endif
27640  if (likely(v)) {
27641  int one = 1; int is_little = (int)*(unsigned char *)&one;
27642  unsigned char *bytes = (unsigned char *)&val;
27643  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27644  bytes, sizeof(val),
27645  is_little, !is_unsigned);
27646  Py_DECREF(v);
27647  if (likely(!ret))
27648  return val;
27649  }
27650 #endif
27651  return (int) -1;
27652  }
27653  } else {
27654  int val;
27655  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27656  if (!tmp) return (int) -1;
27657  val = __Pyx_PyInt_As_int(tmp);
27658  Py_DECREF(tmp);
27659  return val;
27660  }
27661 raise_overflow:
27662  PyErr_SetString(PyExc_OverflowError,
27663  "value too large to convert to int");
27664  return (int) -1;
27665 raise_neg_overflow:
27666  PyErr_SetString(PyExc_OverflowError,
27667  "can't convert negative value to int");
27668  return (int) -1;
27669 }
27670 
27671 /* CIntFromPy */
27672  static CYTHON_INLINE long __Pyx_PyInt_As_long(PyObject *x) {
27673  const long neg_one = (long) -1, const_zero = (long) 0;
27674  const int is_unsigned = neg_one > const_zero;
27675 #if PY_MAJOR_VERSION < 3
27676  if (likely(PyInt_Check(x))) {
27677  if (sizeof(long) < sizeof(long)) {
27678  __PYX_VERIFY_RETURN_INT(long, long, PyInt_AS_LONG(x))
27679  } else {
27680  long val = PyInt_AS_LONG(x);
27681  if (is_unsigned && unlikely(val < 0)) {
27682  goto raise_neg_overflow;
27683  }
27684  return (long) val;
27685  }
27686  } else
27687 #endif
27688  if (likely(PyLong_Check(x))) {
27689  if (is_unsigned) {
27690 #if CYTHON_USE_PYLONG_INTERNALS
27691  const digit* digits = ((PyLongObject*)x)->ob_digit;
27692  switch (Py_SIZE(x)) {
27693  case 0: return (long) 0;
27694  case 1: __PYX_VERIFY_RETURN_INT(long, digit, digits[0])
27695  case 2:
27696  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27697  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27698  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27699  } else if (8 * sizeof(long) >= 2 * PyLong_SHIFT) {
27700  return (long) (((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27701  }
27702  }
27703  break;
27704  case 3:
27705  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27706  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27707  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27708  } else if (8 * sizeof(long) >= 3 * PyLong_SHIFT) {
27709  return (long) (((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27710  }
27711  }
27712  break;
27713  case 4:
27714  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27715  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27716  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27717  } else if (8 * sizeof(long) >= 4 * PyLong_SHIFT) {
27718  return (long) (((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0]));
27719  }
27720  }
27721  break;
27722  }
27723 #endif
27724 #if CYTHON_COMPILING_IN_CPYTHON
27725  if (unlikely(Py_SIZE(x) < 0)) {
27726  goto raise_neg_overflow;
27727  }
27728 #else
27729  {
27730  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27731  if (unlikely(result < 0))
27732  return (long) -1;
27733  if (unlikely(result == 1))
27734  goto raise_neg_overflow;
27735  }
27736 #endif
27737  if (sizeof(long) <= sizeof(unsigned long)) {
27738  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned long, PyLong_AsUnsignedLong(x))
27739 #ifdef HAVE_LONG_LONG
27740  } else if (sizeof(long) <= sizeof(unsigned PY_LONG_LONG)) {
27741  __PYX_VERIFY_RETURN_INT_EXC(long, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27742 #endif
27743  }
27744  } else {
27745 #if CYTHON_USE_PYLONG_INTERNALS
27746  const digit* digits = ((PyLongObject*)x)->ob_digit;
27747  switch (Py_SIZE(x)) {
27748  case 0: return (long) 0;
27749  case -1: __PYX_VERIFY_RETURN_INT(long, sdigit, (sdigit) (-(sdigit)digits[0]))
27750  case 1: __PYX_VERIFY_RETURN_INT(long, digit, +digits[0])
27751  case -2:
27752  if (8 * sizeof(long) - 1 > 1 * PyLong_SHIFT) {
27753  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27754  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27755  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27756  return (long) (((long)-1)*(((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27757  }
27758  }
27759  break;
27760  case 2:
27761  if (8 * sizeof(long) > 1 * PyLong_SHIFT) {
27762  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27763  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27764  } else if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27765  return (long) ((((((long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27766  }
27767  }
27768  break;
27769  case -3:
27770  if (8 * sizeof(long) - 1 > 2 * PyLong_SHIFT) {
27771  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27772  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27773  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27774  return (long) (((long)-1)*(((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27775  }
27776  }
27777  break;
27778  case 3:
27779  if (8 * sizeof(long) > 2 * PyLong_SHIFT) {
27780  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27781  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27782  } else if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27783  return (long) ((((((((long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27784  }
27785  }
27786  break;
27787  case -4:
27788  if (8 * sizeof(long) - 1 > 3 * PyLong_SHIFT) {
27789  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27790  __PYX_VERIFY_RETURN_INT(long, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27791  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27792  return (long) (((long)-1)*(((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27793  }
27794  }
27795  break;
27796  case 4:
27797  if (8 * sizeof(long) > 3 * PyLong_SHIFT) {
27798  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27799  __PYX_VERIFY_RETURN_INT(long, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27800  } else if (8 * sizeof(long) - 1 > 4 * PyLong_SHIFT) {
27801  return (long) ((((((((((long)digits[3]) << PyLong_SHIFT) | (long)digits[2]) << PyLong_SHIFT) | (long)digits[1]) << PyLong_SHIFT) | (long)digits[0])));
27802  }
27803  }
27804  break;
27805  }
27806 #endif
27807  if (sizeof(long) <= sizeof(long)) {
27808  __PYX_VERIFY_RETURN_INT_EXC(long, long, PyLong_AsLong(x))
27809 #ifdef HAVE_LONG_LONG
27810  } else if (sizeof(long) <= sizeof(PY_LONG_LONG)) {
27811  __PYX_VERIFY_RETURN_INT_EXC(long, PY_LONG_LONG, PyLong_AsLongLong(x))
27812 #endif
27813  }
27814  }
27815  {
27816 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
27817  PyErr_SetString(PyExc_RuntimeError,
27818  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
27819 #else
27820  long val;
27821  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
27822  #if PY_MAJOR_VERSION < 3
27823  if (likely(v) && !PyLong_Check(v)) {
27824  PyObject *tmp = v;
27825  v = PyNumber_Long(tmp);
27826  Py_DECREF(tmp);
27827  }
27828  #endif
27829  if (likely(v)) {
27830  int one = 1; int is_little = (int)*(unsigned char *)&one;
27831  unsigned char *bytes = (unsigned char *)&val;
27832  int ret = _PyLong_AsByteArray((PyLongObject *)v,
27833  bytes, sizeof(val),
27834  is_little, !is_unsigned);
27835  Py_DECREF(v);
27836  if (likely(!ret))
27837  return val;
27838  }
27839 #endif
27840  return (long) -1;
27841  }
27842  } else {
27843  long val;
27844  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
27845  if (!tmp) return (long) -1;
27846  val = __Pyx_PyInt_As_long(tmp);
27847  Py_DECREF(tmp);
27848  return val;
27849  }
27850 raise_overflow:
27851  PyErr_SetString(PyExc_OverflowError,
27852  "value too large to convert to long");
27853  return (long) -1;
27854 raise_neg_overflow:
27855  PyErr_SetString(PyExc_OverflowError,
27856  "can't convert negative value to long");
27857  return (long) -1;
27858 }
27859 
27860 /* CIntFromPy */
27861  static CYTHON_INLINE char __Pyx_PyInt_As_char(PyObject *x) {
27862  const char neg_one = (char) -1, const_zero = (char) 0;
27863  const int is_unsigned = neg_one > const_zero;
27864 #if PY_MAJOR_VERSION < 3
27865  if (likely(PyInt_Check(x))) {
27866  if (sizeof(char) < sizeof(long)) {
27867  __PYX_VERIFY_RETURN_INT(char, long, PyInt_AS_LONG(x))
27868  } else {
27869  long val = PyInt_AS_LONG(x);
27870  if (is_unsigned && unlikely(val < 0)) {
27871  goto raise_neg_overflow;
27872  }
27873  return (char) val;
27874  }
27875  } else
27876 #endif
27877  if (likely(PyLong_Check(x))) {
27878  if (is_unsigned) {
27879 #if CYTHON_USE_PYLONG_INTERNALS
27880  const digit* digits = ((PyLongObject*)x)->ob_digit;
27881  switch (Py_SIZE(x)) {
27882  case 0: return (char) 0;
27883  case 1: __PYX_VERIFY_RETURN_INT(char, digit, digits[0])
27884  case 2:
27885  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27886  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27887  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27888  } else if (8 * sizeof(char) >= 2 * PyLong_SHIFT) {
27889  return (char) (((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27890  }
27891  }
27892  break;
27893  case 3:
27894  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27895  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27896  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27897  } else if (8 * sizeof(char) >= 3 * PyLong_SHIFT) {
27898  return (char) (((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27899  }
27900  }
27901  break;
27902  case 4:
27903  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27904  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27905  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27906  } else if (8 * sizeof(char) >= 4 * PyLong_SHIFT) {
27907  return (char) (((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0]));
27908  }
27909  }
27910  break;
27911  }
27912 #endif
27913 #if CYTHON_COMPILING_IN_CPYTHON
27914  if (unlikely(Py_SIZE(x) < 0)) {
27915  goto raise_neg_overflow;
27916  }
27917 #else
27918  {
27919  int result = PyObject_RichCompareBool(x, Py_False, Py_LT);
27920  if (unlikely(result < 0))
27921  return (char) -1;
27922  if (unlikely(result == 1))
27923  goto raise_neg_overflow;
27924  }
27925 #endif
27926  if (sizeof(char) <= sizeof(unsigned long)) {
27927  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned long, PyLong_AsUnsignedLong(x))
27928 #ifdef HAVE_LONG_LONG
27929  } else if (sizeof(char) <= sizeof(unsigned PY_LONG_LONG)) {
27930  __PYX_VERIFY_RETURN_INT_EXC(char, unsigned PY_LONG_LONG, PyLong_AsUnsignedLongLong(x))
27931 #endif
27932  }
27933  } else {
27934 #if CYTHON_USE_PYLONG_INTERNALS
27935  const digit* digits = ((PyLongObject*)x)->ob_digit;
27936  switch (Py_SIZE(x)) {
27937  case 0: return (char) 0;
27938  case -1: __PYX_VERIFY_RETURN_INT(char, sdigit, (sdigit) (-(sdigit)digits[0]))
27939  case 1: __PYX_VERIFY_RETURN_INT(char, digit, +digits[0])
27940  case -2:
27941  if (8 * sizeof(char) - 1 > 1 * PyLong_SHIFT) {
27942  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27943  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27944  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27945  return (char) (((char)-1)*(((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27946  }
27947  }
27948  break;
27949  case 2:
27950  if (8 * sizeof(char) > 1 * PyLong_SHIFT) {
27951  if (8 * sizeof(unsigned long) > 2 * PyLong_SHIFT) {
27952  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27953  } else if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27954  return (char) ((((((char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27955  }
27956  }
27957  break;
27958  case -3:
27959  if (8 * sizeof(char) - 1 > 2 * PyLong_SHIFT) {
27960  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27961  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27962  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27963  return (char) (((char)-1)*(((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27964  }
27965  }
27966  break;
27967  case 3:
27968  if (8 * sizeof(char) > 2 * PyLong_SHIFT) {
27969  if (8 * sizeof(unsigned long) > 3 * PyLong_SHIFT) {
27970  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27971  } else if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27972  return (char) ((((((((char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27973  }
27974  }
27975  break;
27976  case -4:
27977  if (8 * sizeof(char) - 1 > 3 * PyLong_SHIFT) {
27978  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27979  __PYX_VERIFY_RETURN_INT(char, long, -(long) (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27980  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27981  return (char) (((char)-1)*(((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27982  }
27983  }
27984  break;
27985  case 4:
27986  if (8 * sizeof(char) > 3 * PyLong_SHIFT) {
27987  if (8 * sizeof(unsigned long) > 4 * PyLong_SHIFT) {
27988  __PYX_VERIFY_RETURN_INT(char, unsigned long, (((((((((unsigned long)digits[3]) << PyLong_SHIFT) | (unsigned long)digits[2]) << PyLong_SHIFT) | (unsigned long)digits[1]) << PyLong_SHIFT) | (unsigned long)digits[0])))
27989  } else if (8 * sizeof(char) - 1 > 4 * PyLong_SHIFT) {
27990  return (char) ((((((((((char)digits[3]) << PyLong_SHIFT) | (char)digits[2]) << PyLong_SHIFT) | (char)digits[1]) << PyLong_SHIFT) | (char)digits[0])));
27991  }
27992  }
27993  break;
27994  }
27995 #endif
27996  if (sizeof(char) <= sizeof(long)) {
27997  __PYX_VERIFY_RETURN_INT_EXC(char, long, PyLong_AsLong(x))
27998 #ifdef HAVE_LONG_LONG
27999  } else if (sizeof(char) <= sizeof(PY_LONG_LONG)) {
28000  __PYX_VERIFY_RETURN_INT_EXC(char, PY_LONG_LONG, PyLong_AsLongLong(x))
28001 #endif
28002  }
28003  }
28004  {
28005 #if CYTHON_COMPILING_IN_PYPY && !defined(_PyLong_AsByteArray)
28006  PyErr_SetString(PyExc_RuntimeError,
28007  "_PyLong_AsByteArray() not available in PyPy, cannot convert large numbers");
28008 #else
28009  char val;
28010  PyObject *v = __Pyx_PyNumber_IntOrLong(x);
28011  #if PY_MAJOR_VERSION < 3
28012  if (likely(v) && !PyLong_Check(v)) {
28013  PyObject *tmp = v;
28014  v = PyNumber_Long(tmp);
28015  Py_DECREF(tmp);
28016  }
28017  #endif
28018  if (likely(v)) {
28019  int one = 1; int is_little = (int)*(unsigned char *)&one;
28020  unsigned char *bytes = (unsigned char *)&val;
28021  int ret = _PyLong_AsByteArray((PyLongObject *)v,
28022  bytes, sizeof(val),
28023  is_little, !is_unsigned);
28024  Py_DECREF(v);
28025  if (likely(!ret))
28026  return val;
28027  }
28028 #endif
28029  return (char) -1;
28030  }
28031  } else {
28032  char val;
28033  PyObject *tmp = __Pyx_PyNumber_IntOrLong(x);
28034  if (!tmp) return (char) -1;
28035  val = __Pyx_PyInt_As_char(tmp);
28036  Py_DECREF(tmp);
28037  return val;
28038  }
28039 raise_overflow:
28040  PyErr_SetString(PyExc_OverflowError,
28041  "value too large to convert to char");
28042  return (char) -1;
28043 raise_neg_overflow:
28044  PyErr_SetString(PyExc_OverflowError,
28045  "can't convert negative value to char");
28046  return (char) -1;
28047 }
28048 
28049 /* CheckBinaryVersion */
28050  static int __Pyx_check_binary_version(void) {
28051  char ctversion[4], rtversion[4];
28052  PyOS_snprintf(ctversion, 4, "%d.%d", PY_MAJOR_VERSION, PY_MINOR_VERSION);
28053  PyOS_snprintf(rtversion, 4, "%s", Py_GetVersion());
28054  if (ctversion[0] != rtversion[0] || ctversion[2] != rtversion[2]) {
28055  char message[200];
28056  PyOS_snprintf(message, sizeof(message),
28057  "compiletime version %s of module '%.100s' "
28058  "does not match runtime version %s",
28059  ctversion, __Pyx_MODULE_NAME, rtversion);
28060  return PyErr_WarnEx(NULL, message, 1);
28061  }
28062  return 0;
28063 }
28064 
28065 /* ModuleImport */
28066  #ifndef __PYX_HAVE_RT_ImportModule
28067 #define __PYX_HAVE_RT_ImportModule
28068 static PyObject *__Pyx_ImportModule(const char *name) {
28069  PyObject *py_name = 0;
28070  PyObject *py_module = 0;
28071  py_name = __Pyx_PyIdentifier_FromString(name);
28072  if (!py_name)
28073  goto bad;
28074  py_module = PyImport_Import(py_name);
28075  Py_DECREF(py_name);
28076  return py_module;
28077 bad:
28078  Py_XDECREF(py_name);
28079  return 0;
28080 }
28081 #endif
28082 
28083 /* TypeImport */
28084  #ifndef __PYX_HAVE_RT_ImportType
28085 #define __PYX_HAVE_RT_ImportType
28086 static PyTypeObject *__Pyx_ImportType(const char *module_name, const char *class_name,
28087  size_t size, int strict)
28088 {
28089  PyObject *py_module = 0;
28090  PyObject *result = 0;
28091  PyObject *py_name = 0;
28092  char warning[200];
28093  Py_ssize_t basicsize;
28094 #ifdef Py_LIMITED_API
28095  PyObject *py_basicsize;
28096 #endif
28097  py_module = __Pyx_ImportModule(module_name);
28098  if (!py_module)
28099  goto bad;
28100  py_name = __Pyx_PyIdentifier_FromString(class_name);
28101  if (!py_name)
28102  goto bad;
28103  result = PyObject_GetAttr(py_module, py_name);
28104  Py_DECREF(py_name);
28105  py_name = 0;
28106  Py_DECREF(py_module);
28107  py_module = 0;
28108  if (!result)
28109  goto bad;
28110  if (!PyType_Check(result)) {
28111  PyErr_Format(PyExc_TypeError,
28112  "%.200s.%.200s is not a type object",
28113  module_name, class_name);
28114  goto bad;
28115  }
28116 #ifndef Py_LIMITED_API
28117  basicsize = ((PyTypeObject *)result)->tp_basicsize;
28118 #else
28119  py_basicsize = PyObject_GetAttrString(result, "__basicsize__");
28120  if (!py_basicsize)
28121  goto bad;
28122  basicsize = PyLong_AsSsize_t(py_basicsize);
28123  Py_DECREF(py_basicsize);
28124  py_basicsize = 0;
28125  if (basicsize == (Py_ssize_t)-1 && PyErr_Occurred())
28126  goto bad;
28127 #endif
28128  if (!strict && (size_t)basicsize > size) {
28129  PyOS_snprintf(warning, sizeof(warning),
28130  "%s.%s size changed, may indicate binary incompatibility. Expected %zd, got %zd",
28131  module_name, class_name, basicsize, size);
28132  if (PyErr_WarnEx(NULL, warning, 0) < 0) goto bad;
28133  }
28134  else if ((size_t)basicsize != size) {
28135  PyErr_Format(PyExc_ValueError,
28136  "%.200s.%.200s has the wrong size, try recompiling. Expected %zd, got %zd",
28137  module_name, class_name, basicsize, size);
28138  goto bad;
28139  }
28140  return (PyTypeObject *)result;
28141 bad:
28142  Py_XDECREF(py_module);
28143  Py_XDECREF(result);
28144  return NULL;
28145 }
28146 #endif
28147 
28148 /* InitStrings */
28149  static int __Pyx_InitStrings(__Pyx_StringTabEntry *t) {
28150  while (t->p) {
28151  #if PY_MAJOR_VERSION < 3
28152  if (t->is_unicode) {
28153  *t->p = PyUnicode_DecodeUTF8(t->s, t->n - 1, NULL);
28154  } else if (t->intern) {
28155  *t->p = PyString_InternFromString(t->s);
28156  } else {
28157  *t->p = PyString_FromStringAndSize(t->s, t->n - 1);
28158  }
28159  #else
28160  if (t->is_unicode | t->is_str) {
28161  if (t->intern) {
28162  *t->p = PyUnicode_InternFromString(t->s);
28163  } else if (t->encoding) {
28164  *t->p = PyUnicode_Decode(t->s, t->n - 1, t->encoding, NULL);
28165  } else {
28166  *t->p = PyUnicode_FromStringAndSize(t->s, t->n - 1);
28167  }
28168  } else {
28169  *t->p = PyBytes_FromStringAndSize(t->s, t->n - 1);
28170  }
28171  #endif
28172  if (!*t->p)
28173  return -1;
28174  if (PyObject_Hash(*t->p) == -1)
28175  return -1;
28176  ++t;
28177  }
28178  return 0;
28179 }
28180 
28181 static CYTHON_INLINE PyObject* __Pyx_PyUnicode_FromString(const char* c_str) {
28182  return __Pyx_PyUnicode_FromStringAndSize(c_str, (Py_ssize_t)strlen(c_str));
28183 }
28184 static CYTHON_INLINE const char* __Pyx_PyObject_AsString(PyObject* o) {
28185  Py_ssize_t ignore;
28186  return __Pyx_PyObject_AsStringAndSize(o, &ignore);
28187 }
28188 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28189 #if !CYTHON_PEP393_ENABLED
28190 static const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28191  char* defenc_c;
28192  PyObject* defenc = _PyUnicode_AsDefaultEncodedString(o, NULL);
28193  if (!defenc) return NULL;
28194  defenc_c = PyBytes_AS_STRING(defenc);
28195 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28196  {
28197  char* end = defenc_c + PyBytes_GET_SIZE(defenc);
28198  char* c;
28199  for (c = defenc_c; c < end; c++) {
28200  if ((unsigned char) (*c) >= 128) {
28201  PyUnicode_AsASCIIString(o);
28202  return NULL;
28203  }
28204  }
28205  }
28206 #endif
28207  *length = PyBytes_GET_SIZE(defenc);
28208  return defenc_c;
28209 }
28210 #else
28211 static CYTHON_INLINE const char* __Pyx_PyUnicode_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28212  if (unlikely(__Pyx_PyUnicode_READY(o) == -1)) return NULL;
28213 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28214  if (likely(PyUnicode_IS_ASCII(o))) {
28215  *length = PyUnicode_GET_LENGTH(o);
28216  return PyUnicode_AsUTF8(o);
28217  } else {
28218  PyUnicode_AsASCIIString(o);
28219  return NULL;
28220  }
28221 #else
28222  return PyUnicode_AsUTF8AndSize(o, length);
28223 #endif
28224 }
28225 #endif
28226 #endif
28227 static CYTHON_INLINE const char* __Pyx_PyObject_AsStringAndSize(PyObject* o, Py_ssize_t *length) {
28228 #if __PYX_DEFAULT_STRING_ENCODING_IS_ASCII || __PYX_DEFAULT_STRING_ENCODING_IS_DEFAULT
28229  if (
28230 #if PY_MAJOR_VERSION < 3 && __PYX_DEFAULT_STRING_ENCODING_IS_ASCII
28231  __Pyx_sys_getdefaultencoding_not_ascii &&
28232 #endif
28233  PyUnicode_Check(o)) {
28234  return __Pyx_PyUnicode_AsStringAndSize(o, length);
28235  } else
28236 #endif
28237 #if (!CYTHON_COMPILING_IN_PYPY) || (defined(PyByteArray_AS_STRING) && defined(PyByteArray_GET_SIZE))
28238  if (PyByteArray_Check(o)) {
28239  *length = PyByteArray_GET_SIZE(o);
28240  return PyByteArray_AS_STRING(o);
28241  } else
28242 #endif
28243  {
28244  char* result;
28245  int r = PyBytes_AsStringAndSize(o, &result, length);
28246  if (unlikely(r < 0)) {
28247  return NULL;
28248  } else {
28249  return result;
28250  }
28251  }
28252 }
28253 static CYTHON_INLINE int __Pyx_PyObject_IsTrue(PyObject* x) {
28254  int is_true = x == Py_True;
28255  if (is_true | (x == Py_False) | (x == Py_None)) return is_true;
28256  else return PyObject_IsTrue(x);
28257 }
28258 static PyObject* __Pyx_PyNumber_IntOrLongWrongResultType(PyObject* result, const char* type_name) {
28259 #if PY_MAJOR_VERSION >= 3
28260  if (PyLong_Check(result)) {
28261  if (PyErr_WarnFormat(PyExc_DeprecationWarning, 1,
28262  "__int__ returned non-int (type %.200s). "
28263  "The ability to return an instance of a strict subclass of int "
28264  "is deprecated, and may be removed in a future version of Python.",
28265  Py_TYPE(result)->tp_name)) {
28266  Py_DECREF(result);
28267  return NULL;
28268  }
28269  return result;
28270  }
28271 #endif
28272  PyErr_Format(PyExc_TypeError,
28273  "__%.4s__ returned non-%.4s (type %.200s)",
28274  type_name, type_name, Py_TYPE(result)->tp_name);
28275  Py_DECREF(result);
28276  return NULL;
28277 }
28278 static CYTHON_INLINE PyObject* __Pyx_PyNumber_IntOrLong(PyObject* x) {
28279 #if CYTHON_USE_TYPE_SLOTS
28280  PyNumberMethods *m;
28281 #endif
28282  const char *name = NULL;
28283  PyObject *res = NULL;
28284 #if PY_MAJOR_VERSION < 3
28285  if (likely(PyInt_Check(x) || PyLong_Check(x)))
28286 #else
28287  if (likely(PyLong_Check(x)))
28288 #endif
28289  return __Pyx_NewRef(x);
28290 #if CYTHON_USE_TYPE_SLOTS
28291  m = Py_TYPE(x)->tp_as_number;
28292  #if PY_MAJOR_VERSION < 3
28293  if (m && m->nb_int) {
28294  name = "int";
28295  res = m->nb_int(x);
28296  }
28297  else if (m && m->nb_long) {
28298  name = "long";
28299  res = m->nb_long(x);
28300  }
28301  #else
28302  if (likely(m && m->nb_int)) {
28303  name = "int";
28304  res = m->nb_int(x);
28305  }
28306  #endif
28307 #else
28308  if (!PyBytes_CheckExact(x) && !PyUnicode_CheckExact(x)) {
28309  res = PyNumber_Int(x);
28310  }
28311 #endif
28312  if (likely(res)) {
28313 #if PY_MAJOR_VERSION < 3
28314  if (unlikely(!PyInt_Check(res) && !PyLong_Check(res))) {
28315 #else
28316  if (unlikely(!PyLong_CheckExact(res))) {
28317 #endif
28318  return __Pyx_PyNumber_IntOrLongWrongResultType(res, name);
28319  }
28320  }
28321  else if (!PyErr_Occurred()) {
28322  PyErr_SetString(PyExc_TypeError,
28323  "an integer is required");
28324  }
28325  return res;
28326 }
28327 static CYTHON_INLINE Py_ssize_t __Pyx_PyIndex_AsSsize_t(PyObject* b) {
28328  Py_ssize_t ival;
28329  PyObject *x;
28330 #if PY_MAJOR_VERSION < 3
28331  if (likely(PyInt_CheckExact(b))) {
28332  if (sizeof(Py_ssize_t) >= sizeof(long))
28333  return PyInt_AS_LONG(b);
28334  else
28335  return PyInt_AsSsize_t(x);
28336  }
28337 #endif
28338  if (likely(PyLong_CheckExact(b))) {
28339  #if CYTHON_USE_PYLONG_INTERNALS
28340  const digit* digits = ((PyLongObject*)b)->ob_digit;
28341  const Py_ssize_t size = Py_SIZE(b);
28342  if (likely(__Pyx_sst_abs(size) <= 1)) {
28343  ival = likely(size) ? digits[0] : 0;
28344  if (size == -1) ival = -ival;
28345  return ival;
28346  } else {
28347  switch (size) {
28348  case 2:
28349  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28350  return (Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28351  }
28352  break;
28353  case -2:
28354  if (8 * sizeof(Py_ssize_t) > 2 * PyLong_SHIFT) {
28355  return -(Py_ssize_t) (((((size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28356  }
28357  break;
28358  case 3:
28359  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28360  return (Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28361  }
28362  break;
28363  case -3:
28364  if (8 * sizeof(Py_ssize_t) > 3 * PyLong_SHIFT) {
28365  return -(Py_ssize_t) (((((((size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28366  }
28367  break;
28368  case 4:
28369  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28370  return (Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28371  }
28372  break;
28373  case -4:
28374  if (8 * sizeof(Py_ssize_t) > 4 * PyLong_SHIFT) {
28375  return -(Py_ssize_t) (((((((((size_t)digits[3]) << PyLong_SHIFT) | (size_t)digits[2]) << PyLong_SHIFT) | (size_t)digits[1]) << PyLong_SHIFT) | (size_t)digits[0]));
28376  }
28377  break;
28378  }
28379  }
28380  #endif
28381  return PyLong_AsSsize_t(b);
28382  }
28383  x = PyNumber_Index(b);
28384  if (!x) return -1;
28385  ival = PyInt_AsSsize_t(x);
28386  Py_DECREF(x);
28387  return ival;
28388 }
28389 static CYTHON_INLINE PyObject * __Pyx_PyBool_FromLong(long b) {
28390  return b ? __Pyx_NewRef(Py_True) : __Pyx_NewRef(Py_False);
28391 }
28392 static CYTHON_INLINE PyObject * __Pyx_PyInt_FromSize_t(size_t ival) {
28393  return PyInt_FromSize_t(ival);
28394 }
28395 
28396 
28397 #endif /* Py_PYTHON_H */
double f(double C, double b, double a, int q, int r)